Configure Boost in Xcode

Boost is a set of C++ libraries including over 160 libraries providing extra functions in algorithms, data structure, memory, and some other categories.

I am going to use some functions in boost. Here is how to configure Boost in Xcode.

Installation

After downloading and extract the source files, enter the extracted directory and type

./bootstrap.sh --prefix=/usr/local/boost_1_75_0
./b2 install

prefix part sets the location to install bootstrap.

Configure

In Xcode, click the project in left panel and the settings of the project will show. Go to “Build Settings” and set “Header Search Paths” as “/usr/local/boost_1_75_0/include” and “Library Search Paths” as “/usr/local/boost_1_75_0/lib” in “Search Paths”.

We also need to set “Other Linker Flags” in In “Linking”. For example, if we use library “iostreams” in Boost, we should set “-lboost_iostreams” for “Other Linker Flags” in “Linking”.

Avatar
Gang Peng
Associate Research Scientist in Biostatistics

My research interests include biostatistics, bioinformatics, and data mining.

comments powered by Disqus