0

我在编译程序时遇到问题,这是我使用的 gcc 选项

g++ -shared -fPIC -fvisibility -L/usr/lib/x86_64-linux-gnu/  -lboost_serialization-mt -lboost_thread-mt -lboost_date_time-mt -lboost_iostreams-mt -lboost_program_options-mt -lboost_filesystem-mt -lboost_system-mt 

输出

relocation R_X86_64_32S against `vtable for boost::detail::sp_counted_base' can not be used when making a shared object; recompile with -fPIC

could not read symbols: Bad value

有谁知道为什么会这样?谢谢

4

1 回答 1

0

使用安装 boost 库apt-get install libboost

如果您在安装 libboost 时遇到任何问题,请参阅此链接以澄清问题。完成此操作后,您可以使用 -fPIC 标志重新编译 boost 以解决问题。我认为警告本身有助于识别您的问题。

于 2012-12-06T07:16:19.540 回答