Home >Backend Development >C++ >How to Fix the 'undefined reference to boost::system::system_category()' Linking Error in Ubuntu 11.10?
Linking Error with Boost's 'system' Category
When attempting to compile a program utilizing Boost libraries on Ubuntu 11.10, users encounter the "undefined reference to boost::system::system_category()" error. This issue arises due to discrepancies in library dependencies.
Solution
The specific Boost library being used in this program requires the support of the boost_system library. To resolve the error, include the following flag in the compiler command line when using gcc:
-lboost_system
This flag instructs the compiler to link the program with the necessary boost_system library, eliminating the undefined reference error.
The above is the detailed content of How to Fix the 'undefined reference to boost::system::system_category()' Linking Error in Ubuntu 11.10?. For more information, please follow other related articles on the PHP Chinese website!