5

Boost 1.54 ライブラリをコンパイルして使用しようとしていますが、行き詰まりました。

ドキュメントに記載されているように、ライブラリをコンパイルしてインストールしました。

./bootstrap.sh
./b2 install

次を使用して完全な再インストールを試みました:

./bootstrap.sh
./b2 threading=multi install

と を使用-lboost_thread-L*pathて boost*/bin.v2/libs にリンクしました

次のリンカ エラーが引き続き発生します。

undefined reference to boost::thread::start_thread_noexcept()
undefined reference to boost::thread::join_noexcept()

Eclipse の Ubuntu 12.04 で gcc 4.6.3 を使用しています。

これを修正する方法を知っている人はいますか?

4

1 に答える 1

4

ubuntuリポジトリのデフォルトのブーストでかなり苦労した後、ブースト1.54.0(公式Webページから)をデフォルトのオプションでインストールしたところ、次のように機能しました。

g++ test.cpp -o test -L/usr/local/lib/ -lboost_thread

PS: Ubuntu 12.04 ではgcc 4.63

P.S2: 私に含まれるtest.cppもの:

#include "boost/thread/thread.hpp"
#include  "boost/bind.hpp"
于 2013-09-06T06:13:30.997 に答える