开发者

Calling 32 bit lib files from 64 bit targeted application

开发者 https://www.devze.com 2023-02-15 14:52 出处:网络
I am writing a 64 bit ta开发者_运维技巧rgeted 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 LNK200

I am writing a 64 bit ta开发者_运维技巧rgeted 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消