我有一个用x86配置创建的库文件,遗憾的是,我没有它的项目文件。现在,我需要在另一个具有x64配置的项目中使用该库文件(在x86中制作)。有没有办法我可以将该库文件转换为 x64而没有原始项目文件?
我注意到其他论坛/线程讨论IPC机制(我无法跟随)。感谢是否有人帮我解决了这个问题。
提前致谢。
解决方案
您不能在64位进程中直接使用32位库。如果不使用64位编译器重新编译它,就不能将32位库转换为64位。正如您所注意到的,IPC是您可以用来完成工作的唯一机制。
首先创建一个使用32位库的32位EXE。基本上你有一个64位的EXE和一个32位的EXE,它们必须相互通信。
对于IPC,你可以在Windows上使用几种机制,如消息传递,文件映射,套接字, RPC等。
在此处阅读 - 进程间通信
在列出的方法中,套接字或管道最容易实现
I have a library file that was created with x86 configuration and unfortunately, i do not have its project file. Now, I need to use that library file (made in x86) in another project with x64 configuration. Is there way I can convert that library file to x64 with out having its original project file?
I notice from other forums/threads discussing about IPC mechanism (which I am unable to follow). Appreciate if someone helps me to resolve this issue.
Thanks in advance.
解决方案You cannot directly use a 32-bit library in a 64-bit process. Not can you convert a 32-bit library to 64-bit without recompiling it with a 64-bit compiler. As you correctly noticed, IPC is the only mechanism you can use to get your job done.
First create a 32-bit EXE that uses the 32-bit library. Basically you have a 64-bit EXE and a 32-bit EXE which must communicate with each other.
For IPC, you can use several mechanisms on Windows like Messaging, File Mapping, Sockets, RPC etc.
Read about it here -InterProcess Communication
Among the listed methods, sockets or pipes would be the easiest to implement.
更多推荐
LNK1112错误:在x64配置中使用x86库
发布评论