Call 32-bit lib files from a 64-bit target application

I am writing a 64 bit target program in C ++. I need to call commands from a third-party .lib file oriented to a 32-bit environment, however, when I try to do this, I get LNK2001 error. Can this be done?

+4
source share
2 answers

Not directly, no; you cannot associate 32-bit code with a 64-bit executable.

Perhaps you could create a separate 32-bit process to host your static library and write a stub program in your 64-bit program to the Ubip library that uses interprocess communication so that the 32-bit process executes code on your behalf.

+7
source

You cannot do this directly in the application.

Your best option is to get a 64-bit version of the library.

If you cannot do this, you can create a separate 32-bit application that acts as an intermediary between your main program and the library, using sockets or channels for communication.

+4
source

Source: https://habr.com/ru/post/1342711/


All Articles