Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

g++ -m32 can not find libstdc++ on debian amd64

Tags:

c++

debian

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.

like image 616
fzhou Avatar asked Jul 30 '11 17:07

fzhou


1 Answers

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

like image 185
M_D_K Avatar answered Oct 17 '22 17:10

M_D_K