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
Release: 2024-11-12 14:29:01
Original
244 people have browsed it

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
Copy after login

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!

source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template