I am writing a 64 bit targeted c++ program. I need to call commands from a 3rd party .lib file that is targeted towards a 32 bit environment, however when trying to do so I get a LNK2001 error. Is it possible to do this?
Not directly, no; you can't link 32-bit code into a 64-bit executable.
Perhaps you could create a separate 32-bit process to host your static lib and write a stub API in your 64-bit program that uses interprocess communication to have the 32-bit process execute the code on your behalf.
You can't do this directly within an application.
Your best option is to get a 64-bit version of the library.
If you can't do that, you can create a separate 32-bit app that acts as a mediator between your main program and the library, using sockets or pipes to communicate.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With