How to add boost library to Code::Blocks in Linux

2020-02-29 15:54发布

How to add the boost library to a Code::Blocks project in Linux Ubuntu? For example I want to add regex lib.

I've already installed the boost library with:

sudo apt-get install libboost-all-dev

Full example how to will be most valuable.

2条回答
爱情/是我丢掉的垃圾
2楼-- · 2020-02-29 16:15

Two steps to finish:

  1. Include the header files. If you set everything as default, the headers will be installed at

/usr/include/boost

. 2. Select the links you're going to use during compiling. It's default location is

/usr/lib

ATTENTION: It seems to me that the

-lboost_system

is always needed. So be careful if you need -lboost_filesystem or some libs else.

查看更多
疯言疯语
3楼-- · 2020-02-29 16:25

Just add -lboost_regex to the link options and you should be fine. Other often used dependencies: -lboost_system -lboost_serialization -lboost_thread -lpthread -lboost_filesystem

查看更多
登录 后发表回答