
Daniel [daniel.cubetek@gmail.com] 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