更新时间:2023-10-17 08:43:10
类似的问题,运行以下:
For all those stuck with a similar problem, run the following:
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 ),您需要添加它。
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.
我假设我如何保证动态链接库将被找到?意味着我如何确保它总是找到不是它不会找到,你需要这样做
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"
对于那些不设置前缀的用户,它是/ usr / local / lib64
For those who don't bother setting a prefix, it is /usr/local/lib64
在安装gcc时,如果您阅读make输出,您可以简单地找到这一点:
You can find this mentioned briefly when you install gcc if you read the make output:
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很简单!还如果你偶然想要链接到安装的库 - 认真?
Grr that was simple! Also "if you ever happen to want to link against the installed libraries" - seriously?