/usr/lib/x86_64-linux-gnu/libstdc++.so.6:未找到版本 CXXABI_1.3.8'

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20357033/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-07 01:32:11  来源:igfitidea点击:

/usr/lib/x86_64-linux-gnu/libstdc++.so.6: version CXXABI_1.3.8' not found

c++linuxunix

提问by Alec Teal

I recently asked for help https://stackoverflow.com/questions/20253515/no-idea-as-to-usr-lib-x86-64-linux-gnu-libstdc-so-6-version-cxxabi-1-3-8and it got downvoted and closed (I don't know why)

我最近寻求帮助https://stackoverflow.com/questions/20253515/no-idea-as-to-usr-lib-x86-64-linux-gnu-libstdc-so-6-version-cxxabi-1-3 -8,它被否决并关闭(我不知道为什么)

It turns out that "make install" - the make target that installs and implies the target "install-target-libstdc++v3" doesn't actually mean you're ready to go.

事实证明,“make install”——安装并暗示目标“install-target-libstdc++v3”的make目标实际上并不意味着你已经准备好了。

I've been stuck for a while wondering what I was doing wrong because I assumed that such a make target would do that for me.

我已经被困了一段时间想知道我做错了什么,因为我认为这样的 make 目标会为我做这件事。

I hope this answer helps at least one other person.

我希望这个答案至少可以帮助另一个人。

采纳答案by Alec Teal

For all those stuck with a similar problem, run the following:

对于所有遇到类似问题的人,请运行以下命令:

LD_LIBRARY_PATH=/usr/local/lib64/:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH

When you compile and install GCC it does put the libraries here but that's it. As the FAQs say ( http://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.how_to_set_paths) you need to add it.

当您编译和安装 GCC 时,它确实将库放在这里,但仅此而已。正如常见问题解答所说(http://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.how_to_set_paths),您需要添加它。

I assumed "How do I insure that the dynamically linked library will be found? " meant "how do I make sure it is always found" not "it wont be found, you need to do this"

我假设“我如何确保找到动态链接库?”意思是“我如何确保它总是被找到”而不是“它不会被找到,你需要这样做”

For those who don't bother setting a prefix, it is /usr/local/lib64

对于那些不想设置前缀的人来说,它是 /usr/local/lib64

You can find this mentioned briefly when you install gcc if you read the make output:

如果您阅读 make 输出,您可以在安装 gcc 时找到简要提到的这一点:

Libraries have been installed in:
   /usr/local/lib/../lib32
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages. 

Grr that was simple! Also "if you ever happen to want to link against the installed libraries" - seriously?

嗯,这很简单!还有“如果你碰巧想链接到已安装的库” - 认真的?

回答by Ogi Moore

I ran into this issue on my Ubuntu-64 system when attempting to import fst within python as such:

当我尝试在 python 中导入 fst 时,我在我的 Ubuntu-64 系统上遇到了这个问题:

    Python 3.4.3 |Continuum Analytics, Inc.| (default, Jun  4 2015, 15:29:08)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import fst
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ogi/miniconda3/lib/python3.4/site-packages/pyfst-0.2.3.dev0-py3.4-linux-x86_64.egg/fst/__init__.py", line 1, in <module>
    from fst._fst import EPSILON, EPSILON_ID, SymbolTable,\
ImportError: /home/ogi/miniconda3/lib/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/local/lib/libfst.so.1)

I then ran:

然后我跑了:

ogi@ubuntu:~/miniconda3/lib$ find ~/ -name "libstdc++.so.6"
/home/ogi/miniconda3/lib/libstdc++.so.6
/home/ogi/miniconda3/pkgs/libgcc-5-5.2.0-2/lib/libstdc++.so.6
/home/ogi/miniconda3/pkgs/libgcc-4.8.5-1/lib/libstdc++.so.6
find: `/home/ogi/.local/share/jupyter/runtime': Permission denied
ogi@ubuntu:~/miniconda3/lib$

mv /home/ogi/miniconda3/lib/libstdc++.so.6 /home/ogi/miniconda3/libstdc++.so.6.old
cp /home/ogi/miniconda3/libgcc-5-5.2.0-2/lib/libstdc++.so.6 /home/ogi/miniconda3/lib/

At which point I was then able to load the library

那时我就​​可以加载库了

ogi@ubuntu:~/miniconda3/lib$ python
Python 3.4.3 |Continuum Analytics, Inc.| (default, Jun  4 2015, 15:29:08)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import fst
>>> exit()

回答by Marek Tichy

Had the same error when installing PhantomJS on Ubuntu 14.04 64bit with gcc-4.8 (CXXABI_1.3.7)

在使用 gcc-4.8 (CXXABI_1.3.7) 的 Ubuntu 14.04 64 位上安装 PhantomJS 时出现同样的错误

Upgrading to gcc-4.9 (CXXABI_1.3.8) fixed the issue. HOWTO: https://askubuntu.com/questions/466651/how-do-i-use-the-latest-gcc-4-9-on-ubuntu-14-04

升级到 gcc-4.9 (CXXABI_1.3.8) 解决了这个问题。如何:https: //askubuntu.com/questions/466651/how-do-i-use-the-latest-gcc-4-9-on-ubuntu-14-04

回答by Footniko

I had the same problem on my Ubuntu 14.04 when tried to install TopTracker. I got such errors:

尝试安装 TopTracker 时,我在 Ubuntu 14.04 上遇到了同样的问题。我收到了这样的错误:

/usr/share/toptracker/bin/TopTracker: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version 'CXXABI_1.3.8' not found (required by /usr/share/toptracker/bin/TopTracker) /usr/share/toptracker/bin/TopTracker: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version 'GLIBCXX_3.4.21' not found (required by /usr/share/toptracker/bin/TopTracker) /usr/share/toptracker/bin/TopTracker: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version 'CXXABI_1.3.9' not found (required by /usr/share/toptracker/bin/TopTracker)

/usr/share/toptracker/bin/TopTracker:/usr/lib/x86_64-linux-gnu/libstdc++.so.6:未找到版本“CXXABI_1.3.8”(/usr/share/toptracker/bin/TopTracker 需要) /usr/share/toptracker/bin/TopTracker:/usr/lib/x86_64-linux-gnu/libstdc++.so.6:未找到版本“GLIBCXX_3.4.21”(/usr/share/toptracker/bin/TopTracker 需要) /usr/share/toptracker/bin/TopTracker:/usr/lib/x86_64-linux-gnu/libstdc++.so.6:未找到版本“CXXABI_1.3.9”(/usr/share/toptracker/bin/TopTracker 需要)

But I then installed gcc 4.9 version and problem gone:

但是我然后安装了 gcc 4.9 版本并且问题消失了:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.9 g++-4.9

回答by Vipin Jain

This solution work on my case i am using ubuntu 16.04, VirtualBox 2.7.2 and genymotion 2.7.2 Same error come in my system i have followed simple step and my problem was solve

这个解决方案适用于我的情况,我使用的是 ubuntu 16.04、VirtualBox 2.7.2 和 genymotion 2.7.2 同样的错误出现在我的系统中,我遵循了简单的步骤,我的问题得到了解决

1. $ LD_LIBRARY_PATH=/usr/local/lib64/:$LD_LIBRARY_PATH
2. $ export LD_LIBRARY_PATH
3. $ sudo apt-add-repository ppa:ubuntu-toolchain-r/test
4. $ sudo apt-get update
5. $ sudo apt-get install gcc-4.9 g++-4.9

I hope this will work for you

我希望这对你有用

回答by Yuliia Ashomok

I've got correct solution here.

我在这里有正确的解决方案。

The best way to correctly install gcc-4.9 and set it as your default gcc versionuse:

正确安装 gcc-4.9 并将其设置为默认 gcc 版本的最佳方法是:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.9 g++-4.9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9

The --slave, with g++, will cause g++ to be switched along with gcc, to the same version. But, at this point gcc-4.9 will be your only version configured in update-alternatives, so add 4.8 to update-alternatives, so there actually is an alternative, by using:

带有 g++ 的 --slave 将导致 g++ 与 gcc 一起切换到相同的版本。但是,此时 gcc-4.9 将是您在 update-alternatives 中配置的唯一版本,因此将 4.8 添加到 update-alternatives,因此实际上有一个替代方案,通过使用:

sudo apt-get install gcc-4.8 g++-4.8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8

Then you can check which one that is set, and change back and forth using:

然后您可以检查设置了哪一个,并使用以下方法来回更改:

sudo update-alternatives --config gcc

NOTE: You could skip installing the PPA Repository and just use /usr/bin/gcc-4.9-base but I prefer using the fresh updated toolchains.

注意:您可以跳过安装 PPA 存储库而只使用 /usr/bin/gcc-4.9-base 但我更喜欢使用最新更新的工具链。

回答by Britton Kerin

What the other answers suggest will work for the program in question, but it has the potential to cause breakage in other programs and unknown dependence elsewhere. It's better to make a tiny wrapper script:

其他答案所建议的内容适用于相关程序,但它有可能导致其他程序损坏和其他地方未知的依赖性。最好制作一个小包装脚本:

#!/bin/sh
export LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH
program_needing_different_run_time_library_path

This mostly avoids the problem described in Why LD_LIBRARY_PATH is badby confining the effects to the program which needs them.

通过将效果限制在需要它们的程序中,这主要避免了为什么 LD_LIBRARY_PATH 不好中描述的问题。

Note that despite the names LD_RUN_PATH works at link-time and is non-evil, while LD_LIBRARY_PATH works at both link and run time (and isevil :).

请注意,尽管名称 LD_RUN_PATH 在链接时工作并且是非邪恶的,而 LD_LIBRARY_PATH 在链接和运行时都工作(并且邪恶的 :)。

回答by Jose Ospina

In my case it was gcc 6 the one missing

就我而言,缺少的是 gcc 6

sudo apt-get install gcc-6 g++-6 -y

sudo apt-get install gcc-6 g++-6 -y