ldconfig仅链接以lib *开头的文件吗? [英] ldconfig only links files starting with lib*?

查看:147
本文介绍了ldconfig仅链接以lib *开头的文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm struggling to make MVTec Halcon 11 work on Ubuntu. Everything is in the right place but the program doesn't see the dynamic libraries needed for image acquisition (the cameras alone work fine, the driver is installed)

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

I added the path with the libraries to /etc/ld.so.conf and ran ldconfig -v but of the 28 files present in the directory (all "Shared Library" type and .so extension), only the "lib*.so" ones are linked. As a matter of fact, ALL the libraries in the output of ldconfig are called lib*something.

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

Oddly, if I add "lib" in front of the name of the files, they get linked (of course that wouldn't be alright with the software)

那是为什么?

推荐答案

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

From the man of ld.so and ld-linux.so

部分文件:

lib * .so * 共享库

lib*.so* shared libraries

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

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

Looks like you must choose a name begining with lib... The libc uses this to determine if the file may be a shared library.

这篇关于ldconfig仅链接以lib *开头的文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆