libtool 无法加载库
任何人都可以提供任何见解或方法来调试 ltdl 无法加载我的库的原因吗? 正如您从部分 strace 输出中看到的,它成功打开了库,然后报告找不到文件
,然后继续成功加载以相同方式构建的另一个库。我该如何调试这个?我已经在谷歌上搜索了很长时间,但没有找到有用的调试方法。
open("server/modules/smtp.la", O_RDONLY) = -1 ENOENT (No such file or directory)
open("server/modules/smtp.so", O_RDONLY) = 3
getcwd("/home/david/Documents/workspace/dvnmon", 128) = 39
1327209900.751672 3602 Failed to open server/modules/smtp: file not found
open("server/modules/snmp.la", O_RDONLY) = -1 ENOENT (No such file or directory)
open("server/modules/snmp.so", O_RDONLY) = 3
getcwd("/home/david/Documents/workspace/dvnmon", 128) = 39
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/usr/lib64/libnetsnmp.so.15", O_RDONLY) = 3
open("/usr/lib64/libcrypto.so.1.0.0", O_RDONLY) = 3
open("/lib64/libz.so.1", O_RDONLY) = 3
1327209900.800507 3602 Plugin CSNMPMonitor interface version 0.1 loaded
Can anyone provide any insight or way to debug why ltdl is failing to load my library?
As you can see from the partial strace output it succeeds in opening the library, then reports file not found
, and then moves on to successfully load another library built the same way. How can I debug this? I have been googling for ages and found no useful ways of debugging it.
open("server/modules/smtp.la", O_RDONLY) = -1 ENOENT (No such file or directory)
open("server/modules/smtp.so", O_RDONLY) = 3
getcwd("/home/david/Documents/workspace/dvnmon", 128) = 39
1327209900.751672 3602 Failed to open server/modules/smtp: file not found
open("server/modules/snmp.la", O_RDONLY) = -1 ENOENT (No such file or directory)
open("server/modules/snmp.so", O_RDONLY) = 3
getcwd("/home/david/Documents/workspace/dvnmon", 128) = 39
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/usr/lib64/libnetsnmp.so.15", O_RDONLY) = 3
open("/usr/lib64/libcrypto.so.1.0.0", O_RDONLY) = 3
open("/lib64/libz.so.1", O_RDONLY) = 3
1327209900.800507 3602 Plugin CSNMPMonitor interface version 0.1 loaded
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每当
lt_dlopen()
无法加载动态库时,都会报告FILE_NOT_FOUND
。即使文件存在,也可能发生这种情况。我首先会比较 ldd server/modules/smtp.so 和 ldd server/modules/snmp.so 的输出。也许两者之一缺少依赖关系?
您可能还想尝试
export LD_DEBUG=all
(有关详细信息,请参阅man ld.so
)。另外,从您的问题中还不清楚
server/modules/
中的文件是否实际上是 Libtool 模块。如果是,为什么*.la
文件不存在?这些文件可能指定需要首先加载的依赖库。lt_dlopen()
reportsFILE_NOT_FOUND
whenever it fails to load a dynamic library. This can happen even if the file exists.I would first compare the output of
ldd server/modules/smtp.so
and that ofldd server/modules/snmp.so
. Maybe one of the two has a missing dependency?You may also want to try
export LD_DEBUG=all
(seeman ld.so
for details).Also it's not clear from your question if the files in
server/modules/
are actually Libtool modules. If they are, why aren't the*.la
files present? These files may specify dependent libraries that need to be loaded first.