libtool 无法加载库

发布于 2024-12-28 13:04:19 字数 886 浏览 2 评论 0原文

任何人都可以提供任何见解或方法来调试 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

淡笑忘祈一世凡恋 2025-01-04 13:04:19

每当 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() reports FILE_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 of ldd server/modules/snmp.so. Maybe one of the two has a missing dependency?

You may also want to try export LD_DEBUG=all (see man 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文