标签云

微信群

扫码加入我们

WeChat QR Code

I have a shared library that is compiled as 32-bit. Can I use it from a 64-bit application or do I need to compile the shared library as 64-bit as well?


What OS?It probably matters.

2019年06月26日10分14秒

Windows 7 and Red Hat Linux.

2019年06月25日10分14秒

Paul: it actually shouldn't matter. Assuming x86-64, the processor at any given point is either in long mode (64-bit), protected mode (32-bit), or real mode (16-bit). When a thread is scheduled, the mode is set to match the process which can only be one of those. It is a matter of how x86/x86-64 works at its core.

2019年06月25日10分14秒

+1 for asking something seemingly obvious, but this makes it really obvious.

2019年06月25日10分14秒

This clever hack you mention still loads the DLL in a 32 bit process.Do you know of any of these hacks that load the 32 bit DLL in a 64 bit process?

2019年06月26日10分14秒

John: nothing that will work. You can of course do something like allocate memory in your process and manually read the binary code from the 32-bit dll into it. But the processor will treat it as 64-bit instructions which will not operate correctly. It simply cannot be done with the x86-64/x86 architecture.

2019年06月26日10分14秒

+1, even though shared memory, shared files, database tables, RFC, COM, and video screen poking are missing on the IPC techniques list ;) in other words: I suggest to "There are a number of inter-process communication (IPC) techniques:" you add a "some of which are:" phrase.

2019年06月25日10分14秒