Press "Enter" to skip to content

How to compile a 32bits application using a 64bits linux system with gcc


In order to be able to compile a 32 bits application if you are using 64 bits Linux, a -m32 modifier needs to be used.

$ gcc hello.c -m32 -o hello.out

will create a 32 bits application.

$ gcc hello.c -m64 -o hello.out 

will create a 64 bits application.


Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.