4

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

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

奇怪的是,如果我在文件名前添加“lib”,它们就会被链接(当然软件不会这样)

这是为什么?

4

1 回答 1

4

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

部分文件:

lib*.so* 共享库

从 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 使用它来确定文件是否可能是共享库。

于 2012-08-07T09:59:12.760 回答