Linking with 32bit libraries under linux 64bit
Well, you can't mix and match 32-bit and 64-bit code. If you compile all your code using -m32
(to make it build as 32-bit), you may be able to get your application to link if you have 32-bit versions of all your libraries available.
Linking 32-bit library to 64-bit program
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.
Use 32bit shared library from 64bit application?
You must be consistent. A 64-bit application can only use 64-bit libraries and a 32-bit application can only use 32-bit libraries. Both work; either choice is fine, and it's possible to compile the same code for both systems.
If you go for 'all 32-bit', use:
gcc -m32
If you go for 'all 64-bit', use:
gcc -m64
Sometimes, I'll tell make
that the C compiler is gcc -m32
(or -m64
) rather than just gcc
to ensure the right value is used everywhere.
32 bit standard C library on 64 bit machine
Try this:
apt-get install ia32-libs
Also, you should compile/link with -m32:
gcc -Wall -pedantic -m32 ...
Related Topics
How to Detect Out-Of-Memory Segfaults
How to Use 'Catdoc' to Display Dock File Encoded in Utf-8
How to Boot with My Latest Rpi-3.18.0 Kernel and Enabling The Device Tree
Replace a String in a File with Contents Copied from Another File
Cpu Usage from Linux Then Using It in a Arithmetic Expression
Relative-To-Executable Path to Ld-Linux Dynamic Linker/Interpreter
Getting The New Squeak 5 to Run on 64 Bit Linux
Find All Instances of Word Occurring in a File
Gitlab: You Are Not Allowed to Access Master! After Moving Gitlab to Another Server
Phony Targets for Parallel Execution of Make
How to Have Chef Reload Global Path