1
votes

I have 32 bit libraries on a 64 bit system so while compiling my code with 32 bit libraries i passed -m32 but this results into another error saying

/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/libstdc++.so when searching for -lstdc++

/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/libstdc++.a when searching for -lstdc++

/usr/bin/ld: cannot find -lstdc++

collect2: error: ld returned 1 exit status

How to solve it?

1
you don't have 32 bit libraries installed, the package is called libstdc++(version); also, -dev package could be helpful - gengisdave
I installed g++-4.6-multilib , ia32-libs-dev, lib32bz2-dev, libc6-dev-i386 and lib32z1-dev. still problem exists - nitin kumar
does exist something like /usr/lib/gcc/x86-linux-gnu/*/libstdc++.so? I'm not sure about the x86-linux-gnu triplet, but in a multilib systems, there must be another directory than x84_64 - gengisdave

1 Answers

1
votes

If you know where 32-bit libraries are installed, you can add -L/path/to/library/directory before -lstdc++