Search code examples
c++installationboostcompilationmanjaro

installation & compilation boost on Manjaro


I installed boost using pacman -S boost boost-libs. When I try to compile a program that uses boost::thread, and I got the following error:

/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

Why does this happen and how can I fix it?


Solution

  • I find the answer in an other question.

    I had to compile using -pthread -lboost_thread.

    thanks for your answer.