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.
本文介绍了Boost库的多种安装方法,包括从源代码构建、使用MacPorts安装等。针对不同的操作系统和编译器提供了详细的步骤说明。
106

被折叠的 条评论
为什么被折叠?



