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

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

相关推荐
C^h3 小时前
c++ string
开发语言·c++
raindayinrain3 小时前
c++高性能--原子操作,无锁编程,操作顺序
开发语言·c++·性能优化
学逆向的3 小时前
C++ 合并命名空间
开发语言·c++·网络安全
Zhao-Jichao4 小时前
VS2026 打包 C++ 程序生成 EXE,借助 Installer Project 扩展工具
开发语言·c++
小徐不徐说5 小时前
C++ 接口与插件设计:从工厂注册到 Qt 动态插件
数据库·c++·qt·系统架构·程序设计
大都督会赢的5 小时前
C++第一节课
开发语言·c++
UIU1145 小时前
P1233 [ICPC 2001 Taejon R] 木棍加工
数据结构·c++·算法·动态规划
TMedical6 小时前
MedPlanning 截骨模拟矫形功能
c++·图像处理·人工智能·qt·健康医疗
qq_406981036 小时前
共享变量一 关于extern与const
开发语言·c++
chari克里8 小时前
QT5.15.2 + msvc2022部署全流程说明(windows可联网环境)
开发语言·c++·qt