Ubuntu22.04 x86_64下为ARM64平台交叉编译Boost1.85

先安装编译工具:

bash 复制代码
sudo apt install build-essential crossbuild-essential-arm64

创建/root/user-config.jam,内容如下:

bash 复制代码
using gcc : arm : aarch64-linux-gnu-g++ ;

注意空格不要少了。

解压源码包并进入目录,执行bootstrap.sh构建出b2工具:

bash 复制代码
./bootstrap.sh

使用b2工具执行编译并安装到指定位置:

bash 复制代码
sudo ./b2 install --prefix=/opt/arm64 
toolset=gcc-arm architecture=arm 
abi=aapcs binary-format=elf 
address-model=64 
--with-context 
--with-coroutine 
--with-filesystem 
--with-json 
--with-locale 
--with-log 
--with-program_options 
--with-serialization 
--with-stacktrace 
--with-thread 
--with-url

需要编译的库根据实际需要增减,执行时写到一行,这里分行便于阅读。

相关推荐
·present·8 小时前
CSAPP(lecture 4_01)
c语言·c++
FPGA小迷弟8 小时前
用 Claude Code 重构遗留系统:从评估到落地的完整实践指南
c++·python·ai·plotly·django·ai编程·claude
程序员-King.9 小时前
【ROS1】Noetic 开发工作流程与常用命令
c++·ubuntu·ros
云深麋鹿9 小时前
C++ | 基于红黑树实现mymap与myset
开发语言·c++
傲世仙尊10 小时前
string增删查改-insert-erase-replace与find加substr组合技
c++
·present·12 小时前
CSAPP(lecture 3)
c++
别动我齐刘海12 小时前
机器人 C++ / 系统联调补强2——异常处理、Protobuf
linux·c++·人工智能·学习·算法·机器学习·机器人
basketball61613 小时前
C++ 中字符串与常见类型的转换总结
开发语言·c++
等我调个Bug13 小时前
C++智能指针通俗讲解
开发语言·c++
kyle~15 小时前
时间同步 --- PTP 与 Scheduled Action Command
c++·数码相机·机器人·传感器