After several hours of working on the Internet, I decided to refuse you and ask you experts. I am trying to create a 32-bit application (xgap if you are interested) in my 64 Ubuntu 11.10. I added CFLAGS = -m32 and LDFLAGS = -L / usr / lib32 to make . Objects are embedded in 32-bit tone. The last step is to link all the objects and libraries for X windows into this executable --- xgap. Somehow he continues to give me this error:
gcc -o xgap xcmds.o utils.o gapgraph.o gaptext.o pty.o popdial.o xgap.o selfile.o -L/usr/lib32 -lXaw -lXmu -lXt -lXext -lX11 -lSM -lICE /usr/bin/ld: skipping incompatible /usr/lib32/libXmu.so when searching for -lXmu ... /usr/bin/ld: i386 architecture of input file `xcmds.o' is incompatible with i386:x86-64 output ...
I installed ia32-libs and mutilib support . I think I just need to get the linker to generate i386 output. I tried putting two ld in my gcc command as shown above: -melf_i386 and -oformat elf32-i386 . But what happens is that gcc no longer searches for the 32-bit library in / usr / lib32 . I wonder if these flags need to be set in a specific order?
Thanks for any idea and help!
EDIT : when I add the -m32 flag in my last gcc command (at the build stage, I reckon), even if I have the -L / usr / lib32 flag, gcc doesn't look in / usr / lib 32 anymore (really weird ...) and generates the following error:
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../libXaw.so when searching for -lXaw /usr/bin/ld: skipping incompatible /usr/lib/libXaw.so when searching for -lXaw /usr/bin/ld: cannot find -lXaw collect2: ld returned 1 exit status
Anyone have an idea why this is happening? I use an automatic tool for customization and creation. I really know how to modify these script files.
gcc 32bit-64bit ld
Rich Dec 07 '11 at 19:15 2011-12-07 19:15
source share