C++ boost usage

Install BOOST

1. Build from source code

Download the new release package from boost official website

For windows, download zip or 7z format and unpack it using 7zip or winrar

For linux/mac os, download tar.gz or tar.bz2, and unpack it by these command.

tar zxf ....tar.gz -C ./ or tar jxf ...tar.bz2 -C ./

cd the boost_1_xx_x

for windows,  run bootstrap.bat to create bjam and b2

for linux/mac os, run ./bootstrap.sh to create bjam and b2

build the library for different compiler: 

for msvc

mkdir msvc # store the msvc libraries

./bjam toolset=msvc-10.0 --build-dir=msvc --build-type=complete --stagedir=msvc --with-filesystem --disablefilesystem2

for gcc

mkdir gcc # store the gcc libraries

./bjam toolset=gcc --build-dir=gcc --build-type=complete --stagedir=gcc --with-filesystem --disablefilesytem2 --layout=versioned

for darwin

mkdir darwin # store the darwin libraries

./bjam toolset=darwin --build-dir=darwin --build-type=complete --stagedir=darwin --with-filsystem --disablefilesystem2 --layout=versioned

2. Use macport to install

download the macport from officail website and then install it.

Run these command to install it.

sudo port selfupdate #update the software tree

port search boost #check whether contains boost

port info boost #check details about boost

sudo port install boost

the boost will be installed under /opt/local/include for header file, /opt/local/ilb for the library. If you want to change the path, need to build the source code using --prefix.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值