14
votes

I got the following error when compiling a simple hello world program on debian amd64 wheezy(testing) with g++ -m32:

/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/libstdc++.so when searching for -lstdc++ /usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/libstdc++.a when searching for -lstdc++ /usr/bin/ld: cannot find -lstdc++ collect2: ld returned 1 exit status

I don't have any problems with gcc -m32. I also installed lib32stdc++ package, but it does not seem to work. Thanks.

2
I think there may be several 32 bit packages you need to install to get this to work (i.e. more than just lib32stdc++).Paul R

2 Answers

20
votes

Pretty sure you need to install g++-4.6-multilib (it would appear you already have gcc-4.6-multilib).

4
votes

Try installing ia32-libs-dev package.