Reputation: 2425
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?
Upvotes: 17
Views: 9556
Reputation: 18243
You cannot load dynamically or statically a 32-bit library from a 64-bit application or vice versa.
There are a number of work-arounds that I am aware of:
There are a number of inter-process communication (IPC) techniques. Here are a few examples:
Upvotes: 8
Reputation: 90513
No, you cannot load a 32-bit library in a 64-bit application through conventional means.
There are some clever hacks out there such as having a 32-bit application which loads the library and exports the functions through an IPC interface, but if you have the option to compile the library as 64-bit, then that is by far the best choice.
Upvotes: 19