【问题标题】:libtool failing to load a librarylibtool 无法加载库
【发布时间】:2012-01-22 05:30:39
【问题描述】:

谁能提供任何见解或方法来调试为什么 ltdl 无法加载我的库? 从部分 strace 输出中可以看出,它成功打开了库,然后报告 file not found,然后继续成功加载以相同方式构建的另一个库。我该如何调试呢?我已经用谷歌搜索了很长时间,但没有发现任何有用的调试方法。

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

【问题讨论】:

    标签: autoconf automake libtool


    【解决方案1】:

    lt_dlopen() 在加载动态库失败时报告FILE_NOT_FOUND。即使文件存在,也会发生这种情况。

    我将首先比较ldd server/modules/smtp.soldd server/modules/snmp.so 的输出。也许两者之一缺少依赖关系?

    您可能还想试试export LD_DEBUG=all(详情请参阅man ld.so)。

    您的问题也不清楚server/modules/ 中的文件是否实际上是Libtool 模块。如果是,为什么不存在 *.la 文件?这些文件可能会指定需要首先加载的依赖库。

    【讨论】:

    • 很酷,这正是我所需要的。 18996: server/modules/smtp.so: error: symbol lookup error: undefined symbol: _ZTI11CSMTPServer (fatal) The .la files are not found because Im symlinking all the models into the same directory and for some reason the symlinks to the .la文件不起作用,但如果我将它指向真实文件或将它们复制到该目录中,它仍然无法加载 smtp。丢失的符号是我的一个符号,它与使用实用程序 .a 文件来分解程序有关,并且它显然在编译父程序时将该符号排除在外
    猜你喜欢
    • 2022-06-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-14
    • 2018-12-01
    • 2013-06-17
    • 2020-06-10
    • 2012-07-30
    相关资源
    最近更新 更多