[Linux] 解決 error while loading shared libraries: libstdc++.so.6 的問題
在 CentOS x64 上面跑 32-bit 的程式真是問題不斷,
繼 glibc 找不到之後,現在又遇到了 libstdc++ 也找不到的問題:
./testserver: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
原本想用 yum install libstdc++.i686 直接解決,但執行時卻發現了下面的問題:
Resolving Dependencies
–> Running transaction check
—> Package libstdc++.i686 0:4.4.6-4.el6 will be installed
–> Processing Dependency: libgcc_s.so.1(GLIBC_2.0) for package: libstdc++-4.4.6-4.el6.i686
–> Processing Dependency: libgcc_s.so.1(GCC_4.2.0) for package: libstdc++-4.4.6-4.el6.i686
–> Processing Dependency: libgcc_s.so.1(GCC_3.3) for package: libstdc++-4.4.6-4.el6.i686
–> Processing Dependency: libgcc_s.so.1(GCC_3.0) for package: libstdc++-4.4.6-4.el6.i686
–> Processing Dependency: libgcc_s.so.1 for package: libstdc++-4.4.6-4.el6.i686
–> Running transaction check
—> Package libgcc.x86_64 0:4.4.6-3.el6 will be updated
—> Package libgcc.i686 0:4.4.6-4.el6 will be installed
—> Package libgcc.x86_64 0:4.4.6-4.el6 will be an update
–> Finished Dependency Resolution
Error: Protected multilib versions: libstdc++-4.4.6-4.el6.i686 != libstdc++-4.4.6-3.el6.x86_64
You could try using –skip-broken to work around the problem
You could try running: rpm -Va –nofiles –nodigest
–> Running transaction check
—> Package libstdc++.i686 0:4.4.6-4.el6 will be installed
–> Processing Dependency: libgcc_s.so.1(GLIBC_2.0) for package: libstdc++-4.4.6-4.el6.i686
–> Processing Dependency: libgcc_s.so.1(GCC_4.2.0) for package: libstdc++-4.4.6-4.el6.i686
–> Processing Dependency: libgcc_s.so.1(GCC_3.3) for package: libstdc++-4.4.6-4.el6.i686
–> Processing Dependency: libgcc_s.so.1(GCC_3.0) for package: libstdc++-4.4.6-4.el6.i686
–> Processing Dependency: libgcc_s.so.1 for package: libstdc++-4.4.6-4.el6.i686
–> Running transaction check
—> Package libgcc.x86_64 0:4.4.6-3.el6 will be updated
—> Package libgcc.i686 0:4.4.6-4.el6 will be installed
—> Package libgcc.x86_64 0:4.4.6-4.el6 will be an update
–> Finished Dependency Resolution
Error: Protected multilib versions: libstdc++-4.4.6-4.el6.i686 != libstdc++-4.4.6-3.el6.x86_64
You could try using –skip-broken to work around the problem
You could try running: rpm -Va –nofiles –nodigest
看起來好像是因為同時有 libstdc++ for 32-bit 和 64-bit 的版本,所以有點衝突了,
我也不太敢就直接試它所謂的 skip-broken,因為不知道會不會有什麼問題…
幸好在這篇文章裡發現了適當的解法,
那就是先安裝 libstdc++,再裝 libstdc++.i686:
yum -y install libstdc++
yum -y install libstdc++.i686
yum -y install libstdc++.i686
這樣安裝完都沒有遇到衝突的問題,而且程式也終於可以執行了~
//
//
(本頁面已被瀏覽過 3,733 次)