You need to install the gcc-mutlilib package. Then:
$ gcc -o hello -m32 hello.c
the -m32 flag tells the compiler to target the 32-bit architecture instead of the 64-bit architecture
Also, you may need to take a look at this looooooong discussion:
http://ubuntuforums.org/showthread.php?t=24575
For kernel compiling, you will need to explicitly specify the architecture:
$ make ARCH=i386 menuconfig
$ make ARCH=i386 bzImage
Happy compiling :)
*** Returning to this issue with Makefiles
just run:
$make CFLAGS=-m32 LDFLAGS=-m32
this adds the -m32 option to both the compiler flags and the linker flags
Popular Posts
-
Debian 5.0 (codenamed "Lenny") is out. Check: http://www.desktoplinux.com/news/NS4199843436.html It appears that Debian 5.0 (aka ...
-
Recently I needed to add a header/footer to an existing PDF file. With some help from this link, I figured it out: http://coding.derkeiler.c...
-
I found this interesting post, quoting: apt-get build-dep glibc apt-get source -b glibc should work or, if you already have the build-depen...
-
You need to install the gcc-mutlilib package. Then: $ gcc -o hello -m32 hello.c the -m32 flag tells the compiler to target the 32-bit archi...
-
I just got this from a friend :) http://www.neatorama.com/2008/02/07/the-evolution-of-tech-companies-logos/
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment