系统相关
首页 > 系统相关> > linux-ldconfig仅链接以lib *开头的文件?

linux-ldconfig仅链接以lib *开头的文件?

作者:互联网

我正在努力使MVTec Halcon 11在Ubuntu上运行.一切都在正确的位置,但是程序看不到图像采集所需的动态库(仅照相机可以正常工作,驱动程序已安装)

我将带有库的路径添加到/etc/ld.so.conf并运行ldconfig -v,但是目录中存在28个文件(所有“ Shared Library”类型和.so扩展名),只有“ lib * .so” ”链接在一起.实际上,ldconfig输出中的所有库都称为lib * something.

奇怪的是,如果我在文件名之前添加“ lib”,它们将被链接(当然,软件不支持)

这是为什么?

解决方法:

来自ld.so和ld-linux.so的人

节文件:

lib*.so*
shared libraries

从glibc(./elf/ldconfig.c):

 712       /* Does this file look like a shared library or is it a hwcap
 713          subdirectory?  The dynamic linker is also considered as
 714          shared library.  */
 715       if (((strncmp (direntry->d_name, "lib", 3) != 0
 716             && strncmp (direntry->d_name, "ld-", 3) != 0)
 717            || strstr (direntry->d_name, ".so") == NULL)
 718           && (
 719 #ifdef _DIRENT_HAVE_D_TYPE
 720               direntry->d_type == DT_REG ||
 721 #endif
 722               !is_hwcap_platform (direntry->d_name)))
 723         continue;

看起来您必须选择一个以lib开头的名称.libc使用它来确定文件是否可能是共享库.

标签:shared-libraries,ubuntu-12-04,linux
来源: https://codeday.me/bug/20191130/2077123.html