HOWTO : Compile x86 software on x86_64 Ubuntu

Step 1 :



Make sure you are using x86_64 Ubuntu system.



sudo apt-get install build-essential gcc-multilib



Step 2 :



Suppose you are using x86_64 system and want to compile a x86 version software.



gcc -m32 test.c -o test



file test



That's all! See you.