/usr/lib/x86_64-linux-gnu/libstdc++.so.6:未找到版本 CXXABI_1.3.8' [英] /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version CXXABI_1.3.8' not found

查看:89
本文介绍了/usr/lib/x86_64-linux-gnu/libstdc++.so.6:未找到版本 CXXABI_1.3.8'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

结果是make install"- 安装并暗示目标install-target-libstdc++v3"的make目标;实际上并不意味着您准备好了.

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 目标会为我做这件事.

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.

推荐答案

将库的路径添加到LD_LIBRARY_PATH环境变量

TL;DR

GCC 要求您在找不到正确版本时手动告诉它您的库所在的位置,这可以通过几种方式完成.一种是将其添加到 LD_LIBRARY_PATH.

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

对于某些,库路径将是 /usr/local/lib64/.其他人报告了为他们工作的库路径 /usr/lib/x86_64-linux-gnu/.

For some, the library path will be /usr/local/lib64/. Others have reported the library path /usr/lib/x86_64-linux-gnu/ working for them instead.

当您编译和安装 GCC 时,它会将库放在这些目录之一中,但仅此而已.根据 libstdc++ 的常见问题解答,我们得到的错误意味着动态链接器找到了错误版本的libstdc++共享库.因为链接器找不到正确的版本,我们必须告诉它在哪里可以找到libstdc++ 库.

When you compile and install GCC it puts the libraries in one of these directories, but that's all it does. According to the FAQs for libstdc++, the error that we got means that the dynamic linker found the wrong version of the libstdc++ shared library. Because the linker can't find the right version, we have to tell it where to find the libstdc++ library.

解决此问题的最简单方法是使用 LD_LIBRARY_PATH 环境变量,这是一个以冒号分隔的目录列表,链接器将在其中搜索共享库.

The simplest way to fix this is to use the LD_LIBRARY_PATH environment variable, which is a colon-separated list of directories in which the linker will search for shared libraries.

还有其他方法可以解决此问题.如果您阅读 make 输出,您可以在安装 gcc 时找到这个和简要提到的其他解决方案:

There are other ways as well to fix this issue. You can find this and the other solutions mentioned briefly when you install gcc if you read the make output:

库已安装在:

/usr/local/lib/../lib32

如果您碰巧想链接到给定目录 LIBDIR 中已安装的库,您必须使用 libtool,并指定库的完整路径名,或者在链接期间使用 `-LLIBDIR' 标志并至少执行以下之一:

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:

  • 在执行期间将 LIBDIR 添加到 `LD_LIBRARY_PATH' 环境变量
  • 在链接期间将 LIBDIR 添加到 `LD_RUN_PATH' 环境变量
  • 使用`-Wl,-rpath -Wl,LIBDIR'链接器标志
  • 让您的系统管理员将 LIBDIR 添加到 `/etc/ld.so.conf'

请参阅有关共享库的任何操作系统文档以获取更多信息,例如 ld(1) 和 ld.so(8) 手册页.

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?

这篇关于/usr/lib/x86_64-linux-gnu/libstdc++.so.6:未找到版本 CXXABI_1.3.8'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆