I am using the Boost headers in my project which is compiled by g++. I downloaded the Boost source and didn’t build it so there are no library files to link.
When I read the Boost website (http://www.boost.org/doc/libs/1_40_0/) it says Boost.Thread requires its corresponding library, but I am happily using the <boost/thread/mutex.hpp>(boost::mutex) header without linking to the Boost thread library.
How do I really tell whether I need to link the corresponding library for using a particular Boost header file or not?
The Boost documentation states whether a given library is header only or not. If you’re using a library which isn’t specified header only, and are not linking against the corresponding library, it’s undefined behavior.
The fact that it happens to work (or seems to work) isn’t really relevant.