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

10,680

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
Share:
10,680
Paul Whelan
Author by

Paul Whelan

Java Developer Linux User

Updated on June 04, 2022

Comments

  • Paul Whelan
    Paul Whelan over 1 year

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

  • Paul Whelan
    Paul Whelan over 14 years
    I'll be apt getting them do you know if this happens by default on ubuntu?