Home >Backend Development >C++ >How to Fix the 'undefined reference to boost::system::system_category()' Linking Error in Ubuntu 11.10?

How to Fix the 'undefined reference to boost::system::system_category()' Linking Error in Ubuntu 11.10?

Linda Hamilton
Linda HamiltonOriginal
2024-11-12 14:29:01212browse

How to Fix the

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn