Boost logo

Boost Users :

From: Eske Christiansen (eske_at_[hidden])
Date: 2002-11-02 11:47:40


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 <boost/thread/thread.hpp>
#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::function0<void,
boost::empty_function_policy, boost::empty_function_mixin,
allocator<boost::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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net