私は次のクラスを持っています -
boost::condition_variable cond_;
コンパイルしようとすると -
[rmitra@butterfly boost]$ make EXE=thread_safe_stack
g++ -L /usr/local/lib -lboost_thread -o thread_safe_stack thread_safe_stack.cpp
次のエラーが表示されます -
thread_safe_stack.cpp:25: error: 'condition_varaible' in namespace 'boost' does not name a type
thread_safe_stack.cpp: メンバー関数 'void thread_safe_stack::push(const T&)':
thread_safe_stack.cpp:34: エラー: 'cond_' はこのスコープで宣言されていませんでした
thread_safe_stack.cpp: メンバー関数 'void thread_safe_stack::pop(T&)':
thread_safe_stack.cpp:42: エラー: 'cond_' はこのスコープで宣言されていませんでした
make: * [exe] エラー 1
何が問題なのか説明してください。ブースト 1.54
を使用しています。ソース ファイルに次のヘッダーが含まれています。
#include <boost/thread.hpp>
#include <boost/thread/thread.hpp>
#include <boost/thread/exceptions.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/pthread/condition_variable_fwd.hpp>
#include <iostream>
#include <stack>
#include <iterator>
#include <algorithm>