I'm compiling a program to assembly code, specifically in 32 bit form, and when I compile without the -m32 flag like so...:
gcc -S examples.c
It compiles fine. However when I do this...
gcc -S -m32 examples.c
I get an error on my include stdlib.h (formatting taken out because it wasn't showing up in the preview window) line like so:
In file included from /usr/include/stdlib.h:25:0,
from examples.c:1:
/usr/include/features.h:324:26: fatal error: bits/predefs.h: No such file or directory
compilation terminated.
What's going on here?
You're missing the 32bit C libraries and headers. These aren't installed in 64bit Ubuntu by default, but you can do it (together with C++) by running:
$ sudo apt-get install g++-multilib
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With