Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

libstdc++ 64bit and 32bit version on the same machine

I am trying to cross compile a version of my software for a 64bit platform. Can I have the 32bit and 64bit version of libstdc++ installed on the same machine without too much worries of breaking my linux install. The Os is 32bit ubuntu.

I have not cross compiled before and just wanted to check that if I set my CFLAGS and LDFLAGS for the appropriate CPU I should be ok once I have the correct versions of libstdc++ installed.

I checked a 64bit version of ubuntu however this has a symbolic link

lib64 -> lib

this would mess up lots if this is the case on a 32bit machine too anyone know how to sort this?

I am hitting the following error at the moment

 [exec] /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.2.4/libstdc++.so
 [exec] /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.2.4/libstdc++.a
 when searching for -lstdc++ [exec] /usr/bin/ld: skipping incompatible

and so on till

 [exec] /usr/bin/ld: cannot find -lstdc++
 [exec] collect2: ld returned 1 exit status

Which seems to be due to fact I do not have the 64bit version of libstdc++

like image 390
Paul Whelan Avatar asked Feb 11 '09 13:02

Paul Whelan


1 Answers

Sure you can.

Just put them into /usr/lib and /usr/lib64, respectively.

Can't check it on Ubuntu, but on Fedora they get there right from the packages:

[~#] repoquery -q -l libstdc++.i386
/usr/lib/libstdc++.so.6
/usr/lib/libstdc++.so.6.0.10

[~#] repoquery -q -l libstdc++.x86_64
/usr/lib64/libstdc++.so.6
/usr/lib64/libstdc++.so.6.0.10
like image 193
Quassnoi Avatar answered Oct 23 '22 03:10

Quassnoi