【发布时间】:2021-07-06 13:09:39
【问题描述】:
我使用 pacman -S boost boost-libs 安装了 boost。
当我尝试编译使用boost::thread 的程序时,出现以下错误:
/usr/bin/ld: /tmp/cc3AkelG.o: warning: relocation against `_ZTVN5boost6detail16thread_data_baseE' in read-only section `.text._ZN5boost6detail16thread_data_baseC2Ev[_ZN5boost6detail16thread_data_baseC5Ev]'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
为什么会发生这种情况,我该如何解决?
【问题讨论】:
-
你使用的是什么版本的 GCC?
-
查看这个关于如何configure your compiler to output errors in english 的问题。这可能会让您更快地得到更好的答案,因为更多的人将能够理解错误。
-
我正在使用 gcc 11.1.0,感谢@He3lixxx 的建议
标签: c++ installation boost compilation manjaro