How do you properly include Boost files (C++ third party library) in XCode? -
i'm running mac osx 10.9.2 (mavericks) , use xcode 5.1.
i've been doing tons of researching how include boost files in program, can't it. have boost saved @ /usr/local/include/boost/. whenever tried include boost files, either doesn't compile, or can't find file, or if find file, collides other file exists (that's seems me). can please provide detailed explanation of how , preferably provide code snippet of sort? please include several different boost files (i.e., ones exist @ top level of boost directory, exist within subdirectories, algorithm files).
there 2 types of inclusions when using boost library:
- libraries
- include templates
for example, array template include, when compiling need send flag clang: -i/usr/local/include/
this way when including array this:
#include "boost/array.hpp"
when including library must build boost on system, using b2 batch files. build using bjam system.
when libs build have link them clang, flags bit different mere include files, example lets suppose want include boost regex library on system named libboost_regex.so, need tell compiler following 2 flags:
-l/usr/local/{boost_build_place}/lib -lboost_regex
the -l tells compiler folder of libraries including project , -l flag tells specific library want, can see, when using -l flag must remove lib preamble , .so.
Comments
Post a Comment