1. 交叉编译过程
本文以 Ubuntu 22.04.5 LTS Desktop 作为 Host,ARMv7 嵌入式设备为 Target,说明 boost_1_74_0.tar.bz2 的交叉编译过程。
- 从 Boost 官网 下载
1.74.0源码包并解压:
wget https://archives.boost.io/release/1.74.0/source/boost_1_74_0.tar.bz2
tar xf boost_1_74_0.tar.bz2
cd boost_1_74_0
- 安装交叉编译器
sudo apt update
sudo apt install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
./bootstrap.sh --with-libraries=thread,filesystem,log,program_options,date_time,test --prefix=`pwd`/_install
修改当前目录下生成的 project-config.jam:
- using gcc ;
+ using gcc : arm : arm-linux-gnueabihf-g++ ;
- 编译和安装
./b2
./b2 install
编译生成 lib 文件的临时存放目录为 stage,./b2 install 将 header, lib 等一系列文件安装到 _install 目录。
更多通过 B2 构建 Boost 资料可参考:
https://www.boost.org/doc/user-guide/getting-started.html
https://www.bfgroup.xyz/b2/manual/release/index.html#b2.tasks.crosscompile
https://www.bfgroup.xyz/b2/manual/release/index.html#b2.overview.configuration
2. 参考资料
[1] https://www.boost.org/
[2] Getting Started
[3] https://www.bfgroup.xyz/b2/
[4] https://www.bfgroup.xyz/b2/manual/release/index.html#b2.tasks.crosscompile
[5] https://www.bfgroup.xyz/b2/manual/release/index.html#b2.overview.configuration
5742

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



