Boost logo

Boost Users :

Subject: Re: [Boost-users] Link issue with condition_variable
From: Carl (carl.fischer_at_[hidden])
Date: 2010-03-19 13:26:41


Bradley W. Settlemyer <settlemyerbw <at> ornl.gov> writes:
> /home/bws/sandbox/aiofs/src/aio/thread_pool_writer.cc:110: undefined
> reference to `boost::condition_variable::notify_one()'
>
> Is condition variable in a different library?

I'm having an identical problem on Ubuntu Karmic with the Boost 1.40 libraries.

My code (test.cpp) is:

#include <boost/thread/thread.hpp>
int main() {
  boost::condition_variable myCond;
  myCond.notify_one();
  return 0;
}

I compile with:
g++ -lboost_thread-mt test.cpp -o test

And get the error:
/tmp/ccj08TQK.o: In function `main': boost.cpp:(.text+0x2b):
undefined reference to `boost::condition_variable::notify_one()'
collect2: ld returned 1 exit status

Any suggestions?

-- Carl


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