小编典典

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

linux

我最近寻求帮助,它被拒绝投票并关闭(我不知道为什么)

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

我一直想知道自己在做什么错了,因为我以为这样的make target可以帮到我。

我希望这个答案至少可以帮助其他人。


阅读 827

收藏
2020-06-02

共1个答案

小编典典

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

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

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

我假设“如何确保可以找到动态链接的库?”的意思是“如何确保始终找到该动态链接的库”,而不是“不会被找到,您需要这样做”

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

如果您阅读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.

太简单了!另外,“如果您碰巧想要链接到已安装的库”,是认真的吗?

2020-06-02