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

P

pranab.salian

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!
 
G

Gigasoft

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
 
B

Ben Voigt [C++ MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top