How to statically linking 2 files for 32 bit and 64 bit in VC++ 2005

I am trying to statically link a xyz.lib file to my 32-bit VC++ 2005
MFC app in order to use a .sys file.

I have two xyz.lib files, one for win32 and one for amd64.

I know I should add the .lib file to ['Property Pages' > 'Linker' >
'Input' > 'Additional Dependencies']

But which file do I add, how do I add both files, and how do I ensure
the 32-bit app can use the linked .sys on 32-bit as well as 64-bit?

Thanks!

0
10/25/2007 10:07:36 PM
vc.mfc 33608 articles. 0 followers. Follow

6 Replies
856 Views

Similar Articles

[PageSpeed] 55

Hi,

Just use the 32 bit lib, your app will run on 64 bit via WOW64.

64 bit development would involve setting up a new cpu platform, which has 
it's own copy of build configuration settings.  Requiring potential porting 
all your code to compile as 64 bit.  Which then won't run on 32 bit.

You generally can't mismatch 32 and 64 bit binaries within an app.

best regards,

Robert Dede
Gigasoft, Inc.
www.gigasoft.com





<pranab.salian@gmail.com> wrote in message 
news:1193350056.887779.144190@i13g2000prf.googlegroups.com...
>I am trying to statically link a xyz.lib file to my 32-bit VC++ 2005
> MFC app in order to use a .sys file.
>
> I have two xyz.lib files, one for win32 and one for amd64.
>
> I know I should add the .lib file to ['Property Pages' > 'Linker' >
> 'Input' > 'Additional Dependencies']
>
> But which file do I add, how do I add both files, and how do I ensure
> the 32-bit app can use the linked .sys on 32-bit as well as 64-bit?
>
> Thanks!
> 


0
robert8450 (10)
10/25/2007 11:19:28 PM
In article <OP-dnU8C0oQXubzanZ2dnUVZ_uiknZ2d@giganews.com>, "Gigasoft" <robert@gigasoft.com> wrote:
>Hi,
>
>Just use the 32 bit lib, your app will run on 64 bit via WOW64.
>
>64 bit development would involve setting up a new cpu platform, which has 
>it's own copy of build configuration settings.  Requiring potential porting 
>all your code to compile as 64 bit.  Which then won't run on 32 bit.
>
>You generally can't mismatch 32 and 64 bit binaries within an app.

There isn't enough advantage to even consider going 64 bit.
A few percent improvement in performance at a risk breaking
things up completely.

-- 
The most powerful Usenet tool you have ever heard of.
NewsMaestro v. 4.0.2 has been released.

Multi-job support and other important feature additions
and various improvements and optimizations.

Web page:
http://newsmaestro.sourceforge.net/

Download page:
http://newsmaestro.sourceforge.net/Download_Information.htm

0
almond1 (17)
10/26/2007 12:00:55 AM
You would have separate directories for 32-bit and 64-bit libraries, or you would name the
libraries with different names, such as xyz32.lib and xyz64.lib.

You would have different build configurations for the 32-bit and the 64-bit values that
named the appropriate directories.  Note that you can use common facilities if you use the
macro capability available for naming paths.

A .sys file is a device driver, and it would not have a .lib file.  It is not even part of
anything a user-level module would have anything to do with.

You do not build device drivers (.sys files) with Visual Studio, you build them using the
DDK build environments.

Please clarify what a .sys file has to do with any user-level code or Visual Studio at
all.
				joe



On Thu, 25 Oct 2007 15:07:36 -0700, pranab.salian@gmail.com wrote:

>I am trying to statically link a xyz.lib file to my 32-bit VC++ 2005
>MFC app in order to use a .sys file.
>
>I have two xyz.lib files, one for win32 and one for amd64.
>
>I know I should add the .lib file to ['Property Pages' > 'Linker' >
>'Input' > 'Additional Dependencies']
>
>But which file do I add, how do I add both files, and how do I ensure
>the 32-bit app can use the linked .sys on 32-bit as well as 64-bit?
>
>Thanks!
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
10/26/2007 3:37:49 AM
It's more than "a few percentage points".  I did some performance measurement of
compute-bound code, and a Win32 app that does no kernel calls but runs a compute-intensive
loop exectutes in n units of time, and the identical code compiled for 64-bit runs in
0.75*n units of time, consistently, for several different kinds of loops, both integer and
floating point loops.
				joe

On Fri, 26 Oct 2007 00:00:55 GMT, almond@brothers.orgy (Almond) wrote:

>In article <OP-dnU8C0oQXubzanZ2dnUVZ_uiknZ2d@giganews.com>, "Gigasoft" <robert@gigasoft.com> wrote:
>>Hi,
>>
>>Just use the 32 bit lib, your app will run on 64 bit via WOW64.
>>
>>64 bit development would involve setting up a new cpu platform, which has 
>>it's own copy of build configuration settings.  Requiring potential porting 
>>all your code to compile as 64 bit.  Which then won't run on 32 bit.
>>
>>You generally can't mismatch 32 and 64 bit binaries within an app.
>
>There isn't enough advantage to even consider going 64 bit.
>A few percent improvement in performance at a risk breaking
>things up completely.
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
10/26/2007 3:39:43 AM
<pranab.salian@gmail.com> wrote in message 
news:1193350056.887779.144190@i13g2000prf.googlegroups.com...
>I am trying to statically link a xyz.lib file to my 32-bit VC++ 2005
> MFC app in order to use a .sys file.
>
> I have two xyz.lib files, one for win32 and one for amd64.
>
> I know I should add the .lib file to ['Property Pages' > 'Linker' >
> 'Input' > 'Additional Dependencies']
>
> But which file do I add, how do I add both files, and how do I ensure
> the 32-bit app can use the linked .sys on 32-bit as well as 64-bit?

By .sys, do you mean a driver?  You cannot have 32-bit drivers on 64-bit 
Windows.  The .sys needs to match Windows, the .lib needs to match your 
application.  If they are well-designed they will automatically handle the 
case of a 32-bit .lib with a 64-bit .sys.

>
> Thanks!
> 

0
rbv (46)
10/26/2007 5:36:16 PM
But a .sys file, if it is a driver, will NEVER have a .lib file because this makes no
sense whatsoever!
				joe

On Fri, 26 Oct 2007 12:36:16 -0500, "Ben Voigt [C++ MVP]" <rbv@nospam.nospam> wrote:

>
><pranab.salian@gmail.com> wrote in message 
>news:1193350056.887779.144190@i13g2000prf.googlegroups.com...
>>I am trying to statically link a xyz.lib file to my 32-bit VC++ 2005
>> MFC app in order to use a .sys file.
>>
>> I have two xyz.lib files, one for win32 and one for amd64.
>>
>> I know I should add the .lib file to ['Property Pages' > 'Linker' >
>> 'Input' > 'Additional Dependencies']
>>
>> But which file do I add, how do I add both files, and how do I ensure
>> the 32-bit app can use the linked .sys on 32-bit as well as 64-bit?
>
>By .sys, do you mean a driver?  You cannot have 32-bit drivers on 64-bit 
>Windows.  The .sys needs to match Windows, the .lib needs to match your 
>application.  If they are well-designed they will automatically handle the 
>case of a 32-bit .lib with a 64-bit .sys.
>
>>
>> Thanks!
>> 
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
10/27/2007 2:57:06 AM
Reply:

Similar Artilces:

Excel 97 VBA Help File
In the MS Excel Visual Basic Reference help file contents page, I click on Functions and it only offers me functions beginning with the letter S. So, I have a list of Solver and SQL functions. But what about all the other functions in VBA, for example for doing arithmetic and manipulating dates and strings? Why don't they show up? Are they left out because those functions are all part of Visual Basic generally, and the Excel VBA help file is specific to the _extra_ functions in Excel VBA? It's the only explanation I can think of. Am I right, or have I got a corrupted help file (vbaxl...

Problems with creating a newsletter
I chose the form "Newsletter - email". I have created a 3 page newsletter. Now, I have NO IDEA how to send it out as an email. I do not want to send it as an attachment. I cannot figure out which "save as" format or what I need to do so that i can email this newsletter. Is there a website that goes through how to do this? Am I correct when I say that it has to be html in order for me to send it as email? That is not one of the options. Any help you give me would be greatly appreciated. Thank you, Markis www.adreamforabetterworld.com ...

Meeting updates #2
My users cannot update meetings created when they were on the old email server. I have noticed that the old string is still mapped to the meeting. e.g x400;c=us;a= ;p=Org name;o=exchagne;s=Lastname;g=firstname; Take a look at the following article: 275134 XADM: Cannot Reply to Messages That Are Sent from a User Account That http://support.microsoft.com/?id=275134 The same thing applies to meetings. How did you move them and what version(s) of Exchange? Thanks, Richard Roddy Microsoft Exchange Support This posting is provided "AS IS" with no warranties, and confers no ri...

Changing SQL Server for CRM 1.2
As my SQL server is currently on its last breath I am in the process of moving our CRM 1.2 databases to a new dedicated serever. I have detatched the databases from the old server, copied the files to the server and attached them. I have then gone into CRM deployment manager and changed to the SQL server to the new server. That all appears to work fine, no error messages. But when users try to access the CRM system they get an error and the CRM server event log fills with error messages. A few are listed below: dmLog: Failed to execute the SQL batch in the file sqlbatch.sql. MSCRM P...

How do you turn off/on the "1" or "2" or "+" or "-" view hide/unh.
What is or how do you control, turn on/off the small "1" "2" or "+" "-" hide/unhide view buttons right above the "A" cell? Sometimes shows when I hide columns. Hi 'Data - Goup/Outline' -- Regards Frank Kabel Frankfurt, Germany Seth wrote: > What is or how do you control, turn on/off the small "1" "2" or "+" > "-" hide/unhide view buttons right above the "A" cell? Sometimes > shows when I hide columns. You can toggle them to hide or display with <Ctrl> <8> Usi...

CFile (delete file)
How can I delete all files that end with ".temp" in some folder? CFile::Remove remove unlink -- cheers, Alok Gupta Blogs: http://wdevs.com/thatsalok "Petar Popara" <my.fake@mail.net> wrote in message news:Op6#URKfFHA.2644@TK2MSFTNGP09.phx.gbl... > > How can I delete all files that end with ".temp" in some folder? > > SHFileOperation() will and it supports wildcards! DeleteFile() will operate on one file at a time. "Petar Popara" <my.fake@mail.net> wrote in message news:Op6%23URKfFHA.2644@TK2MSFTNGP09.phx.gbl... > >...

Steps to Share Outlook on 2 different drives
This is a problem created by a dual boot of XPPSP2 on one drive C:\ and Vista on another drive E:\ that I use to format for new builds of Vista on the same box. I want to take my Outlook 2003 in box and folders on two different drives on one box and combine them so that all the emails go to one account and all the folders can be shared or used on each drive. I want to do the same with Outlook Express as well, and since this is an *Outlook newsgroup, I'll just take what I learn here and apply it to the ..dbx folder(s) in it. The idea is to receive email on both drives in one in one...

printing 2 charts on single page
Using Excel 2k, Win 2k I was trying to print to line charts on a single page to demonstrate the corelation between the two data sets. I would like to print in portait mode with one chart on top of page and one on bottom. Excel only seems to offer putting chart 2 on a separate page or embedding it in chart one. I am not very familiar with excel charting capabilites can anyone suggest a resorce? Thanks ...

Can't open 2005 data file after reinstalling Money 2005
I am experiencing a recurring problem. I have had to reinstall Windows XP and MS Money 2005. I am now unable to open my previously converted 2005 file or restore any backup version. I consistently get the following error message: "Money cannot locate filename or cannot open it, possibly because it is a read-only file, you do not have permission to change it, or your disk drive is write- protected. If you have chosen the correct file and it cannot be accessed, you will need to click OK and then Restore your most recent backup file." Any help or thoughts would be greatly ap...

code examples for BITS
Hi, I am looking for sample codes for programming background intelligent transfer service..I was able to see sample code in .NET, but I'm specifically looking for VC++ 6.0 (command-line application).Please help me.. Thanks, NKH ...

Offline folder problems #2
Hi Guys, Basically I installed Outlook 97 on my office PC which is connect to microsoft exchange server. For some reason all of my messages were copied into offline folders, this causes a problem, whenever I open up outlook I get this message. Upload of offline changes could not be completed you do not have sufficient permission to perform this operation on this object. See the folder contact or see your system administrator. I do not administrator access on my user profile, every time I open outlook it resets everything I have changed (view etc) and gives that error message. How ...

CSV File Problem
Can any one explain why the following problem occurs please? A colleague has a small list of data which is a csv file exported from SQL. Column One is a serial number from 1 to 29. Column 2 is a number of transactions which have occurred.(it should look like example A below in Excel) 1 475 1,475 2 1732 21,732 3 1670 31,670 4 2176 42,176 5 608 5,608 6 1579 61,579 7 43101 743,101 8 54512 854,512 9 51258 951,258 10 61050 1,061,050 A B If I double click on the csv file, it opens in Excel but c...

import a 123 file
My excel version cannot open a Lotus 123 file. Is there an import feature to move the data from Lotus 123 to Excel? Thanks No, you need to convert the file either from Lotus 123 or get commercial converter -- Regards, Peo Sjoblom "Frank" <Frank@discussions.microsoft.com> wrote in message news:59B55F98-4C79-4917-928B-F1B309660730@microsoft.com... > My excel version cannot open a Lotus 123 file. Is there an import feature > to > move the data from Lotus 123 to Excel? > Thanks > > ...

Public Folder link to Excel File
Hi - I have a user that claims that he had a shortcut to a spreadsheet "in his public folders" at his old job. Obviously, he's an end user that may or may not know what he's talking about.... I'm trying to figure out the best way to accomodate him. He basically wants an Excel file stored on a shared folder to be available to all user as either a shortcut, or a link in the public folders (can't post to a folder as he will be updating the sheet regularly). When a user clicks on the shortcut/link, it would just launch Excel and display the file. Anybody have any ideas...

#Delete Mark in Bound Memo filed
I have form that has bound memo field, sometime, no sure how it happen, the memo filed is filled with #Delete. My application is a stand alone program. Kindly advise what can cause this and how to avoid it from happening. -- TS Lim When was the last time you performed a compact and repair? Is you db split? Does each user have their own copy of the front-end? Please checkout http://www.granite.ab.ca/access/corruptmdbs.htm http://www.granite.ab.ca/access/corruption/symptoms.htm http://office.microsoft.com/en-ca/access/HA011865661033.aspx - No very helpful but directly from MS ...

Receiving Transaction Entry #2
I went into Receiving Transaction Entry to record the receipt of an item. The invoiced price did not agree with the purchase order. I had to add Shipping and adjust the provincial tax. I went to the proper screen to over-ride the calculated tax and the system told me that I couldn't do that because I had not filled in all the BOLD, RED areas. At that point I wanted to close down that screen, but the system would not let me do that either. I could minimize the screen and then I could also see that there wasn't any required information that had not be entered. The only way I c...

Opening pub files created with older Publisher versions #2
I have just upgraded to Publisher 2003 from 2000 and am having trouble with pub files sent to me for our chuch newsletter which is using Publisher 97 The text is not wrapping around graphics boxes. Can I fix this? I really don't want to go back to Pub 200 Thank Richard this is caused by Publisher 97 not been printer independent. Even if you went back to Publisher 2000, unless you have the identical font versions and printer driver you would have issues with formatting. It sounds like the person sending you the file has a garbage HP inkjet printer. Get them to install the HP5P laser p...

Renaming Partial File Names
Is it possible to rename part of a file name? (almost like a find and replace) My database pulls in the excel file names from a directory, with it's subfolders and contents as well. Every file begins with "Kay Form". Kay no longer works in our department, and I'd like to run a loop that replaces "Kay Form" with "Featured Track". I don't know how to do a partial replace though. Thank you in advance! -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access/201001/1 Checkout the Replace function. I...

Associating Multiple Existing Contacts to an Account, Until CRM 2.x
I have racked my pea-sized brain for endless days for a way to associate multiple existing contacts (or accounts) to an account. My client has accounts that have many contacts (or accounts) involved at different stages of acquiring a new account. The logical method would be to add a custom attribute with lookup functionality into the existing CRM contact or account objects but this is not possible with CRM 1.x. The resulting UI would allow an end user to associate different contacts (or accounts) to an account. Example: Account: ABC - AccountPhysician: (existing account or con...

Where is the cache files folder located for windows media player?
Does windows media player have a cache files folder? Where is the cache files folder located for windows media player? Or how do I find the cache files folder for windows media player? Thank You for your Help. Bob Background info: I have a desktop AMD 4400+ 64X2 4GB memory 320GB HD(way bigger than I need) Acer computer (AM3100-U3201A) I purchased new February 2008 running 32-bit MS Vista Home Premium SP2 box. I use MS auto updates. I think it has onboard shared memory for video and sound. My ISP is Comcast 12mbps with Motorola SURFboard SB5101 Cable Modem direct to...

VCard issue #2
This is a weird problem, but when I send a vcard to someone, it shows up in my sent items as a vcf file, and has a vcard icon on it, but when the recipient gets the VCard, it shows up as msg file, with an envelope icon as the attachment. When I open it, nothing is there - it's empty. I can't find anything regarding this problem on google or MS's website. Anybody have any ideas? Is it a problem with Outlook? Do I need to do a detect and repair, a reinstallation? Thanks for your help! Does the same happen when you send a message to yourself? Is he/she able to see it w...

Some Excel formatting functions taking a long time to work #2
Excel 2000 SP3 When I use some formatting functions for the first time in a session, such as bold, increasing font size etc, it takes up to 30 seconds to work. Meantime Excel is locked up until it completes that formatting call. I suspect faulty DLL? Has anyone experienced this? How to fix (other than a complete re- install) ? Any advice appreciated. Piri On Nov 5, 8:39=A0am, Piri <wiremu.pare...@hotmail.com> wrote: > Excel 2000 SP3 > When I use some formatting functions for the first time in a > session, such as bold, increasing font size etc, it takes =A0up to 30 > secon...

unknown .edb file
I have error messages in the log files that references a corrupt database named C:\Program Files\exchsrvr\Exchangeserver_Outlook.edb. "Outlook" is the name of the server. The problem is that this database is not listed in any of the Mail Stores or Public stores. I want to run the repair utilities on it, but since I'm not sure what it is used for, I don't know how I can restore it if the repair goes bad. Does anyone know what this is used for or how I can determine that myself? BTW, the database always has a current time stamp, so I assume that it is used by something....

printing imported gif files in Excel
When printing gif file with transparent background on the grey(25%) background of Excel non-transparent part of the picture has white border around it. Is there any way to prevent it? Thank you in advance... Tim ...

Copying dbx files from a CDR back into Outlook
My computer was recently hijakced and I had to reinstall everything. I did however save all of my folders in Outlook onto a CD Rom and I do not know how to transfer them back so I can use them. Also I had an animated version of outlook where you could choose loads of diffent stationery and I cannot seem to find that upgrade anaywhere. Can you help me? Tee <tsahai33@hotmail.com> wrote: > My computer was recently hijakced and I had to reinstall > everything. I did however save all of my folders in > Outlook onto a CD Rom and I do not know how to transfer > them back so...