views:

1563

answers:

2

Hello All

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++

+2  A: 

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
Quassnoi
I'll be apt getting them do you know if this happens by default on ubuntu?
Paul Whelan
A: 

for some reason it seems like some,if not all, I Unbuntu distros lack Lib64. Don't use it myself but similar questions have been asked here about the 64bit libs. Anyways toucan have both installed, no problem in theory.

Robert Gould