mfl*_*ris 5 linux shared-libraries ubuntu-12.04
我正在努力让 MVTec Halcon 11 在 Ubuntu 上运行。一切都在正确的位置,但程序看不到图像采集所需的动态库(相机单独工作正常,驱动程序已安装)
我添加了库的路径并/etc/ld.so.conf运行,ldconfig -v但目录中存在的 28 个文件(所有“共享库”类型和 .so 扩展名)中,只有“lib*.so”文件被链接。事实上,ldconfig 输出中的所有库都称为 lib*something。
奇怪的是,如果我在文件名前面添加“lib”,它们就会被链接(当然,这对软件来说是不行的)
这是为什么?
来自 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;
Run Code Online (Sandbox Code Playgroud)
看起来您必须选择一个以 lib 开头的名称... libc 使用它来确定该文件是否是共享库。