Linking 32-bit library to 64-bit program

夙愿已清 提交于 2019-11-27 09:13:23

No. You can't directly link to 32bit code inside of a 64bit program.

The best option is to compile a 32bit (standalone) program that can run on your 64bit platform (using ia32), and then use a form of inter-process communication to communicate to it from your 64bit program.

Zan Lynx

For an example of using IPC to run 32-bit plugins from 64-bit code, look at the open source NSPluginWrapper.

It is possible, but not without some serious magic behind the scenes and you will not like the answer. Either emulate a 32 bit CPU (no I am not kidding) or switch the main process back to 32 bit. Emulating may be slow though.

This is a proof of concept of the technique.

Then keep a table of every memory access to and from the 32 bit library and keep them in sync. It is very hard to get to a theoretical completeness, but something workable should be pretty easy, but very tedious.

In most cases, I believe two processes and then IPC between the two may actually be easiest, as suggested othwerwise.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!