Autoconf、Libtool 共享和静态库
我正在使用 autoconf gnu 工具来构建我的产品。 它为任何提到 *.la 的库生成共享库和静态库。 问题是如果您使用 .la 链接 Makefile.am 中的二进制文件。 它与动态库链接,但是当您对二进制文件使用 ldd 时,它会说 “不是动态可执行文件”,尽管它与共享库链接。我通过在构建二进制文件后删除共享库来证明这一点,然后尝试运行该二进制文件。它没有找到共享库并且无法运行。 另一个问题是如何使用Makefile.am方向将库放在指定位置?
I am using autoconf gnu tools to build my product.
It generates both the shared as well as static library for any library where *.la is mentioned.
The issue is if you use .la to link your binary in Makefile.am.
It links with the dynamic library but when you use ldd to the binary, it says
"not a dynamic executable" although it links with shared library. I proved it by removing the shared library after the binary is built and then tried to run the binary. It didn't find the shared library and couldn't run.
Another question is how to put library in a specified location using Makefile.am direction ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来您在 libtool 创建的包装器脚本上运行 ldd 。它们用于将已卸载的库与已卸载的可执行文件链接起来。真正的二进制文件放置在 .libs 目录中。
您可以通过这种方式将库安装到某个特定位置
Looks like you run ldd on the wrapper scripts created by libtool. They are used to link uninstalled libraries with uninstalled executables. Real binaries are placed in .libs directory.
You can install a lib to some specific place in this way