【发布时间】:2016-07-22 17:01:39
【问题描述】:
我正在尝试在 Ubuntu Linux 上使用 g++ 5.4.0 创建一个共享库。
我已经构建了 Poco C++ 库的静态库(.a 文件),我想将它们静态链接到我的共享库中。
但它不起作用。
我已将以下字符串添加到我的构建脚本中:
-Wl,-whole-archive -lPocoFoundation -Wl,-no-whole-archive
g++ 报错如下:
relocation R_X86_64_32S against '-ZTVN4Poco15ArchiveStrategyE' can not be used when making a shared object; recompile with -fPIC
有人可以帮忙吗?
【问题讨论】: