I am using gcc to compile a C++ application on my CI server (http://ci.berboe.co.uk) and as the vps that it is compiled on has the x86-64 architecture I need to cross-compile to get the compiled program to work on x86 computers.
I have installed gcc-multilib and g++-multilib and several other packages that were suggested in other places, but I still get an error when trying to compile. It is:
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
Full logs are available here: http://ci.berboe.co.uk/job/MCServer%20Linux-x86/11/console
Any help towards resolving this issue would be much appreciated.
Edit:
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crt1.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crti.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/gcc/x86_64-linux-gnu/4.4.5/crtbegin.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/gcc/x86_64-linux-gnu/4.4.5/crtend.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crtn.o' is incompatible with i386 output
/usr/bin/ld: final link failed: Invalid operation
I get this after having fixed the previous problem.
export LD_LIBRARY_PATH=LD_LIBRARY_PATH:/lib32:/usr/lib32:/usr/lib/i386-linux-gnu– hifkanotiks Feb 07 '13 at 17:49/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.so when searching for -lstdc++ /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a when searching for -lstdc++ /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.so when searching for -lstdc++ /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a when searching for -lstdc++And the command shows locations in /lib32 and /usr/lib32 so it should work. – hifkanotiks Feb 09 '13 at 08:01-m32 -s -g -O3 -DNDEBUG. – hifkanotiks Feb 09 '13 at 20:35/usr/lib/gcc/i386-linux-gnu/.....doesn't exist :( – hifkanotiks Feb 11 '13 at 17:08