开发者

Calling 32 bit lib files from 64 bit targeted application

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜