c - 在linux中将.a文件与.so共享库文件绑定(bind)

标签 c linux gcc libtool

我有一个 .a 文件( ar 命令),我想在 GCC 编译期间将其与我的 .so 文件绑定(bind)。

我怎样才能做到这一点。

如果我运行此命令:

gcc /usr/local/apr/lib/libapr-1.a ../../ndagentlibc/obj/*.o tideways_xhprof.o tracing.o -shared -o libhello.so


nm libhello.so | grep apr_term

output:  U    apr_terminate

apr_terminate 没有得到它的定义

最佳答案

如果您的 .so 文件需要 .a 文件,请将您的 .so.a 链接文件和 .a 存档中的所有所需代码都将在 .so 文件中提供。

关于c - 在linux中将.a文件与.so共享库文件绑定(bind),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51282609/

相关文章:

c++ - While 循环再次重复

linux - 打印 Linux 上所有进程累积的内存和 CPU 百分比

c++ - 使用 c 更新文件

PHP文件上传到另一个目录

linux - 在现场演示中显示 vim 命令键

c - 函数返回指向 C 中数组类型的指针

linux - 配置 apache 2.2.21 时出现 gcc 错误

c - Linux 上的这个 GCC 错误是什么,我该如何解决?海合会 : internal compiler error: Illegal instruction (program as)

c - 如果输入是负数或字母,我如何让我的 if 语句要求用户重试?

c - 为什么许多 init 函数使用一个指针来初始化,而不是返回一个有效的指针?