Fix for incompatible /usr/lib/gcc/x86_64-linux-gnu/4.2.3/libstdc++.so error message
I was recently building a copy of Ice 3.0.1 from ZeroC on x86_64 and ran into the following error message fairly early on:
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.2.3/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.2.3/libstdc++.a when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.2.3/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.2.3/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
collect2: Error: ld returned 1 exit status
make[2]: *** [../../lib/libIceUtil.so.3.0.1] Error 1
But I clearly had libstdc++ version 5 and 6 installed:
# COLUMNS=50 dpkg -l | grep libstdc
ii libstdc++5 1:3.3.6-15ubun The GNU Standard C++ Library v3
ii libstdc++6 4.2.3-2ubuntu7 The GNU Standard C++ Library v3
ii libstdc++6-4.2 4.2.3-2ubuntu7 The GNU Standard C++ Library v3 (development
This works on i386 and 32-bit Linux, so I sought out a fix, and the fix was simple; install g++-multilib:
$ sudo apt-get install g++-multilib
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
g++-4.2-multilib gcc-4.2-multilib lib32gomp1
Suggested packages:
lib32stdc++6-4.2-dbg lib32mudflap0
The following NEW packages will be installed:
g++-4.2-multilib g++-multilib gcc-4.2-multilib lib32gomp1
0 upgraded, 4 newly installed, 0 to remove and 70 not upgraded.
Need to get 1017kB of archives.
After this operation, 4854kB of additional disk space will be used.
Do you want to continue [Y/n]? y
After doing this, you may receive the following error:
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.2.3/../../../libbz2.so when searching for -lbz2
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.2.3/../../../libbz2.a when searching for -lbz2
/usr/bin/ld: skipping incompatible /usr/bin/../lib/libbz2.so when searching for -lbz2
/usr/bin/ld: skipping incompatible /usr/bin/../lib/libbz2.a when searching for -lbz2
/usr/bin/ld: skipping incompatible /usr/lib/libbz2.so when searching for -lbz2
/usr/bin/ld: skipping incompatible /usr/lib/libbz2.a when searching for -lbz2
/usr/bin/ld: cannot find -lbz2
collect2: Error: ld returned 1 exit status
make[2]: *** [../../lib/libIce.so.3.0.1] Error 1
This is due to a similar issue, and the libraries you want are in /usr/lib64/, not /usr/lib.
The fix for this is seems to be buried in Cyrillic on this thread. The fixes proposed there did not work for me, so I had to hack and slash the Make.rules.Linux file and the various Makefile targets below to get that working.
Related Posts:
- FIX: VMware VMW_HAVE_EPOLL error message with current distributions...
- Funny Ubuntu Error Message of the Day...
- VMware “undefined symbol: g_get_user_special_dir” error SOLVED...
- SuSE 10.1 in VMware “No catalogue found” error SOLVED...
- FIXED: There was a problem reading data from the server and BlackBerry App World must exit. Error type: 100002...
- Building TrueCrypt 5.0a on Linux...
- SOLVED: Building VMware Workstation modules on Linux 2.6.32...
- Cleanly installing and running Adobe Air and TweetDeck on 64-bit Linux...
- Locking down users, SourceFubar.Net and the Embedded Linux course I’m writing...
- Patch to build TrueCrypt v4.3a modules on 2.6.23+ kernels...
Last Modified: Friday, May 30th, 2008 @ 12:48
Incoming search terms for the article:
- skipping incompatible libstdc (69)
- /usr/bin/ld: cannot find -lstdc (37)
- cannot find -lstdc (37)
- skipping incompatible /usr/lib/gcc/x86_64-linux-gnu (32)
- cannot find lstdc (22)
- skipping incompatible library (17)
- /usr/bin/ld: skipping incompatible (14)
- incompatible libstdc (13)
- skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/ (12)
- /usr/bin/ld: cannot find lstdc (12)
- skipping incompatible when searching for (9)
- /usr/bin/ld: skipping incompatible /usr/lib/gcc/ libstdc so when searching for -lstdc (9)
- /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu (9)
- cannot find -lbz2 (8)
- /usr/bin/ld: cannot find -lcrypto (8)
- libstdc incompatible (7)
- ld: cannot find -lstdc (7)
- skipping incompatible (6)
- x86_64-linux-gnu (6)
- /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64 (6)
- usr bin ld cannot find lstdc collect2 ld returned 1 exit status (5)
- gcc x86_64 (5)
- skipping incompatible /usr/lib/libstdc so (5)
- gcc: -pg and -fomit-frame-pointer are incompatible (5)
- linux ld skipping incompatible (5)
- /usr/bin/ld: skipping incompatible libgcc a when searching for -lgcc (5)
- ld skipping incompatible libstdc (5)
- ld: skipping incompatible (5)
- incompatible /usr/lib/gcc/x86_64-linux-gnu (4)
- skipping incompatible /usr/lib64 (4)