Hi all
I'm new to this list and I have a question.
I want to use the thread lib in g++ 2.96.110 under redhat 7.3
I have the test e.x.
#include
#include <iostream>
void hello()
{
std::cout <<
"Hello world, I'm a thread!"
<< std::endl;
}
int main(int argc, char* argv[])
{
boost::thread thrd(&hello);
thrd.join();
return 0;
}
(from cuj.com)
I try to compile with
g++ -lboost_thread foo.cpp
I get the the error(s):
/tmp/ccdoKT37.o: In function `main':
/tmp/ccdoKT37.o(.text+0x53): undefined reference to
`boost::thread::thread(boost::function0boost::function_base > const &)'
/tmp/ccdoKT37.o(.text+0x75): undefined reference to
`boost::thread::join(void)'
/tmp/ccdoKT37.o(.text+0x86): undefined reference to
`boost::thread::~thread(void)'
/tmp/ccdoKT37.o(.text+0xbe): undefined reference to
`boost::thread::~thread(void)'
collect2: ld returned 1 exit status
What do I do wrong. I don't want to use jam og bjam files because all my
works i build by using automake.
yours
eske