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

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

相关推荐
程序员zgh9 分钟前
C++ 互斥锁、读写锁、原子操作、条件变量
c语言·开发语言·jvm·c++
獭.獭.2 小时前
C++ -- STL【unordered_set和unordered_map的使用】
c++·stl·unordered_map·unordered_set
star _chen3 小时前
C++ std::move()详解:从小白到高手
开发语言·c++
福尔摩斯张3 小时前
C++核心特性精讲:从C语言痛点出发,掌握现代C++编程精髓(超详细)
java·linux·c语言·数据结构·c++·驱动开发·算法
charlie1145141914 小时前
如何快速在 VS2026 上使用 C++ 模块 — 完整上手指南
开发语言·c++·笔记·学习·现代c++
报错小能手4 小时前
STL_unordered_map
开发语言·c++·哈希算法
历程里程碑5 小时前
C++ 9 stack_queue:数据结构的核心奥秘
java·开发语言·数据结构·c++·windows·笔记·算法
仰泳的熊猫5 小时前
1108 Finding Average
数据结构·c++·算法·pat考试
AA陈超6 小时前
虚幻引擎5 GAS开发俯视角RPG游戏 P07-18.生成火球术
c++·游戏·ue5·游戏引擎·虚幻
wxin_VXbishe6 小时前
springboot居家养老管理系统-计算机毕业设计源码55953
java·c++·spring boot·python·spring·django·php