I am using Ubuntu + Eclipse and installed boost(not sure correct). I installed Boost using apt-get install libboost*
I tested some simple code, it seems the boost working right.
However, when I try to learn the thread part, the code below does not work.
#include <boost/thread/thread.hpp>
#include <iostream>
using namespace std;
void hello()
{
cout<<"hello!"<<endl;
}
int main()
{
boost::thread thrd(&hello);
cout<<"Just a test!"<<endl;
}
The error information is as follow, there are 4 errors.
Severity and Description Path Resource Location Creation Time Id
/usr/local/include/boost/thread/detail/thread.hpp undefined reference to `boost::detail::thread_data_base::~thread_data_base()' FirstCppProject line 40 1260656497961 200
Severity and Description Path Resource Location Creation Time Id
/usr/local/include/boost/thread/detail/thread.hpp undefined reference to `boost::thread::start_thread()' FirstCppProject line 191 1260656497967 202
Severity and Description Path Resource Location Creation Time Id
/usr/local/include/boost/thread/pthread/thread_data.hpp undefined reference to `vtable for boost::detail::thread_data_base' FirstCppProject line 65 1260656497965 201
Severity and Description Path Resource Location Creation Time Id
undefined reference to `boost::thread::~thread()' FirstCppProject test.cpp line 15 1260656497959 199
Please forgive me if my question is too naive. Please offer any information you think might help me out.