可执行文件无法找到libstdc++版本
我的机器上安装了不同的编译器。默认的libstdc ++。因此在内部 /usr /lib64。 我在“/home/myCompilers/gcc1210”文件夹中安装了GCC 12.1,并且正在使用CLION使用此编译器。可执行文件的构建正确,但是当我尝试运行此可执行文件时,它错误:
/lib64/libstdc++so.6:version“ glibcxx_3.4.29'找不到找到(./project_exe需要),
我已经使用了link_directories (/home/mycompilers/gcc1210/lib64)
命令在cmake中给出libstdc ++的正确路径。因此,但是可执行文件无法在运行时使用它。
在CMAKE中提供运行时库搜索路径的正确方法是什么?
I have different compilers installed on my machine. The default libstdc++.so is inside /usr/lib64.
I installed gcc 12.1 in "/home/myCompilers/gcc1210" folder and I am using my Clion to use this compiler. The executable is built correctly, but when I try to run this executable, it errors out:
/lib64/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by ./project_exe)
I have used link_directories(/home/myCompilers/gcc1210/lib64)
command in CMake, to give the correct path of libstdc++.so, But the executable is not able to use it at run time.
What is the correct way to give runtime library search path in CMake.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我宁愿使用推荐方式设置
rpath
:I'd rather use recommended way for setting
RPATH
:我在libstdc ++也有类似的问题
系统提供GCC -/USR/LIB64/LIBSTDC++.SO.6.0.32
最新的GCC I构建/usr/local/lib64/libstdc++so.6.0.31。
我重新链接到系统.32库。一切都起作用,但是
这不是我通常做的事情。它将暂时做。
I had a similar problem with libstdc++
System provided gcc - /usr/lib64/libstdc++.so.6.0.32
Latest gcc I built /usr/local/lib64/libstdc++.so.6.0.31.
I relinked to the system .32 library. Everything works but
this not something I normally do. It will do for now.