0

最新バージョンのブースト スレッドを使用してプログラムをコンパイルしようとしています。私は使っている

gcc バージョン 4.1.2 20080704 (Red Hat 4.1.2-52)

1.50 では、への参照boost::thread::~thrad()が見つからないという問題がありました。だから私は次のものを手に入れた新しいものに更新しました

      /usr/local/include/boost/thread/detail/thread.hpp:65: error: expected ';' before 'thread_data'
      /usr/local/include/boost/thread/detail/thread.hpp:68: error: expected `;' before 'thread_data'
      /usr/local/include/boost/thread/detail/thread.hpp:88: error: expected ';' before 'thread_data'
      /usr/local/include/boost/thread/detail/thread.hpp:91: error: expected `;' before 'void'
      /usr/local/include/boost/thread/detail/thread.hpp:105: error: expected ';' before 'thread_data'
      /usr/local/include/boost/thread/detail/thread.hpp:108: error: expected `;' before 'void'
      /usr/local/include/boost/thread/detail/thread.hpp:121: error: expected ';' before 'private'
      /usr/local/include/boost/thread/detail/thread.hpp:153: error: expected primary-expression before ')' token
      /usr/local/include/boost/thread/detail/thread.hpp:153: error: there are no arguments to 'BOOST_THREAD_RV_REF' that depend on a template parameter, so a declaration of 'BOOST_THREAD_RV_REF' must be available
      /usr/local/include/boost/thread/detail/thread.hpp:153: error: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
      /usr/local/include/boost/thread/detail/thread.hpp:153: error: expected `)' before 'f'
      /usr/local/include/boost/thread/detail/thread.hpp:153: error: invalid in-class initialization of static data member of non-integral type 'boost::detail::thread_data_ptr'
      /usr/local/include/boost/thread/detail/thread.hpp:153: confused by earlier errors, bailing out

なぜこのようにしているのか、私にはわかりませんでした。回避策はありますか?

4

1 に答える 1

2

OSXのg ++​​ 4.2.1でも同じ問題がありましたが、コンパイラ自体の問題ではないと思います。

以前に、 b2 install を呼び出して、boost ライブラリ/usr/local/libとヘッダーをインストールしました。/usr/local/includeこれは新しいインストールでは機能しますが、以前のブースト インストール (私は 1.49 を持っていました) を正しく上書きしません。私がしなければならなかったのは、ビルドを使用していたブースト ビルド ディレクトリに向けるか、/usr/local/include/boostb2 install を削除して再度実行することだけでした。最初に b2 install を実行したときは高速なライブラリのみをコピーしましたが、2 回目ははるかに時間がかかり、すべてのヘッダー ファイルをコピーしました。

于 2012-09-10T20:36:17.173 に答える