Boost logo

Boost Users :

From: Andrew Holden (aholden_at_[hidden])
Date: 2007-11-29 13:01:08


Daniel [daniel.cubetek_at_[hidden]] wrote:
> Here's the output:
> $ g++ -v -s -I/usr/include/boost -lboost_date_time -pthread
./timer.cpp -o ./timer

I notice you're putting the library name at the beginning of the command
line. Because of the way g++ parses command lines, it will not actually
link in the library. It goes from left to right and only links in
library components that it already knows it needs. -lboost_date_time is
the first source mentioned, and the linker sees no need to bother with
it, because it hasn't yet seen anything that needs it.

It is best to put libraries at the end of the command line, and you may
need to play with their order if one library depends on another.

Try this:

g++ -v -s -I/usr/include/boost -pthread timer.cpp -o timer
-lboost_date_time


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