Undefined reference to boost symbol


I was compiling code from someone using a Makefile. It gave this error:

/usr/bin/ld: main.o: undefined reference to symbol '_ZN5boost6system15system_categoryEv'


If you demangle the C++ symbol _ZN5boost6system15system_categoryEv using C++Filt you get the function boost::system::system_category(). So, the code was using this function, but was missing the library file. Adding the linker directive -lboost_system to include the library, fixed the error.

Tried with: Ubuntu 14.04

One thought on “Undefined reference to boost symbol

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.