Search code examples
c++boost

undefined reference to boost::system::system_category() when compiling


I'm trying to compile a program on Ubuntu 11.10 that uses the Boost libraries. I have the 1.46-dev Boost libraries from the Ubuntu Repository installed, but I get an error when compiling the program.

undefined reference to boost::system::system_category()

What is it that I do wrong?


Solution

  • The boost library you are using depends on the boost_system library. (Not all of them do.)

    Assuming you use gcc, try adding -lboost_system to your compiler command line in order to link against that library.