在Mac OS X 10.9.4 Mavericks编译boost 1.55,并在xcode中使用.

In Mac OS X 10.9 Mavericks compiled boost 1.55, and the use in xcode.

1、Download url. you could download later version.

http://www.boost.org

2、Uncompress. use tar to uncompress it.

tar -zxvf boost_1_55_0.tar.gz

3、Building  boost.

cd boost_1_55_0

./bootstrap.sh --prefix=/Users/<your user name>/Development/Libraries/boostBuilder/ toolset=clang

we set the install path to /Users/<your user name>/Development/Libraries/boostBuilder/ , changes it to yours, the very important is set compiler to clang

4、Execute b2.

./b2 toolset=clang --with-filesystem cxxflags="-arch i386 -arch x86_64 -fvisibility=hidden -fvisibility-inlines-hidden -std=c++11 -stdlib=libc++ -ftemplate-depth=512" linkflags="-stdlib=libc++" link=static stage install

--with-filesystem 表示只编译"filesystem"模块。如果是--without-filesystem表示除了“filesystem”以外的所有模块。

the static libraries are installed at 
"/Users/<your user name>/Development/Libraries/boostBuilder/lib",

and the headers are installed at 
"/Users/<your user name>/Development/Libraries/boostBuilder/include"

5、XCode setting.

add the library path and the header path at Build Settings->Search Paths, then Add files to ...



6、 Add "/Users/ <your user name> /Development/Libraries/boostBuilder/lib/ libboost_filesystem.a ",
"/Users/<your user name>/Development/Libraries/boostBuilder/lib/libboost_system.a
to "Link Binary With Libraries".




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值