1、下载boost源码(boost_1_66_0 2018.01.17 时最新):
地址:https://sourceforge.net/projects/boost/files/boost/
2、解压进入目录 boost_1_66_0 查看当前版本支持的库 如下:
命令:./bootstrap.sh --show-libraries
Building Boost.Build engine with toolset gcc... tools/build/src/engine/bin.linuxx86_64/b2
The following Boost libraries have portions that require a separate build
and installation step. Any library not listed here can be used by including
the headers only.
The Boost libraries requiring separate building and installation are:
- atomic
- chrono
- container
- context
- coroutine
- date_time
- exception
- fiber
- filesystem
- graph
- graph_parallel
- iostreams
- locale
- log
- math
- mpi
- program_options
- python
- random
- regex
- serialization
- signals
- stacktrace
- system
- test
- thread
- timer
- type_erasure
- wave
3、去掉你不需要的库 指定安装目录,使用 --without-libraries=, , , 逗号隔开去掉不想编译的库,--prefix=/../ 指定编译后的安装路径
./bootstrap.sh --without-libraries=atomic,chrono,container,context,coroutine,date_time,exception,fiber,filesystem,graph,graph_parallel,iostreams,locale,log,math,mpi,program_options,python,random,regex,serialization,signals,stacktrace,test,timer,type_erasure
--prefix=/opt/GSRD/arm4.7.3_boost_1_66/
4、上一步骤会生成有 b2 和 bjam ,以及一个 project-config.jam 的文件,修改该文件的一行(指定自己的编译器):
注意:这中间是有空格的,更改Gcc编译器注意空格,gcc后面有一个空格,每个冒号后面有空格,末尾分号也有空格。
if ! gcc in [ feature.values <toolset> ]
{
using gcc : : /home/sfe1012/MrcMoveProject/tools/gcc-linaro-arm-linux-gnueabihf-4.7-2012.11-20121123_linux/bin/arm-linux-gnueabihf-gcc ;
}
5、编译 安装
编译:./bjam 创建的 lib 文件默认在 stage 文件夹。
安装:./bjam install 进行安装到--prefix=/.../ 指定的目录。
6、QtGreator下的应用方法
在XX.pro工程目录中添加
指定头文件位置:INCLUDEPATH += /opt/GSRD/arm4.7.3_boost_1_66/include/
地址:https://sourceforge.net/projects/boost/files/boost/
2、解压进入目录 boost_1_66_0 查看当前版本支持的库 如下:
命令:./bootstrap.sh --show-libraries
Building Boost.Build engine with toolset gcc... tools/build/src/engine/bin.linuxx86_64/b2
The following Boost libraries have portions that require a separate build
and installation step. Any library not listed here can be used by including
the headers only.
The Boost libraries requiring separate building and installation are:
- atomic
- chrono
- container
- context
- coroutine
- date_time
- exception
- fiber
- filesystem
- graph
- graph_parallel
- iostreams
- locale
- log
- math
- mpi
- program_options
- python
- random
- regex
- serialization
- signals
- stacktrace
- system
- test
- thread
- timer
- type_erasure
- wave
3、去掉你不需要的库 指定安装目录,使用 --without-libraries=, , , 逗号隔开去掉不想编译的库,--prefix=/../ 指定编译后的安装路径
./bootstrap.sh --without-libraries=atomic,chrono,container,context,coroutine,date_time,exception,fiber,filesystem,graph,graph_parallel,iostreams,locale,log,math,mpi,program_options,python,random,regex,serialization,signals,stacktrace,test,timer,type_erasure
--prefix=/opt/GSRD/arm4.7.3_boost_1_66/
4、上一步骤会生成有 b2 和 bjam ,以及一个 project-config.jam 的文件,修改该文件的一行(指定自己的编译器):
注意:这中间是有空格的,更改Gcc编译器注意空格,gcc后面有一个空格,每个冒号后面有空格,末尾分号也有空格。
if ! gcc in [ feature.values <toolset> ]
{
using gcc : : /home/sfe1012/MrcMoveProject/tools/gcc-linaro-arm-linux-gnueabihf-4.7-2012.11-20121123_linux/bin/arm-linux-gnueabihf-gcc ;
}
5、编译 安装
编译:./bjam 创建的 lib 文件默认在 stage 文件夹。
安装:./bjam install 进行安装到--prefix=/.../ 指定的目录。
6、QtGreator下的应用方法
在XX.pro工程目录中添加
指定头文件位置:INCLUDEPATH += /opt/GSRD/arm4.7.3_boost_1_66/include/
指定库文件位置及其 所应用的库:LIBS += -L /opt/GSRD/arm4.7.3_boost_1_66/lib/ -lboost_system -lboost_thread
参考:https://www.cnblogs.com/findumars/p/7461244.html
http://blog.csdn.net/z609932088/article/details/50902302