Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linking Boost Library in Linux

People also ask

How do I link my Boost library to code blocks?

Include Boost headers and link with Boost librarieshpp> in your source file. In your project's build options, highlight the root of your project, select the "Linker settings" tab, and add "boost_*-mgwXX-mt-1_47" to your Link libraries.

How do I add a Boost library?

In the properties dialog, select "Configuration Properties" and then "VC++ Directories". You will need to add the Boost include path to the "Include Directories" list. If you're using all header-only libraries then you're done. Otherwise, you will need to add the Boost library path to "Library Directories".

How do I link my Boost library to Visual Studio?

6.1 Link From Within the Visual Studio IDE Right-click example in the Solution Explorer pane and select Properties from the resulting pop-up menu. In Configuration Properties > Linker > Additional Library Directories, enter the path to the Boost binaries, e.g. C:\Program Files\boost\boost_1_55_0\lib\.

Where are Boost libraries installed?

For me, the library path for boost was in /usr/lib64 , and that's all I had to add to my library path for the code to build properly. On a different machine, I found it installed under /usr/lib .


Change -llibboost_system to -lboost_system.

In linux, the "lib" prefix in front of a library is not used when referencing said library.


In this case james' answer was correct, but if anybody else happens to stumble upon this post like I did then be aware that you can get this message if you link old boost headers against newer libraries. get_system_category() specifically has been deprecated. I ran into this problem while accidentally including distro-provided headers but linking against my own internal copy of boost.


If you still get problems you might want to include posix-threads by adding to the linker flags:

-lpthread