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

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

相关推荐
软行1 小时前
LeetCode 每日一题 3876. 构造奇偶一致的数组 II
c++·算法·leetcode
繁星蓝雨2 小时前
C++设计原理———重载(extern “C“的由来、顺序依赖、语义依赖、overload、名称修饰符、对象操作、运算符重载、新增运算符、枚举和布尔类型)
c语言·c++·extern c·overload·重载·语义依赖·顺序依赖
handler012 小时前
【Linux】虚拟地址空间解析
linux·运维·c++·线程·进程·虚拟地址空间·虚拟地址
(Charon)2 小时前
【C++】网络缓冲区设计(二):Ring Buffer环形缓冲区、head/tail与跨界读写
开发语言·c++
码匠许师傅2 小时前
【设计模式精讲】24.观察者模式(Observer)
c++·观察者模式·设计模式·uml
imgsq2 小时前
S-57 数据解剖:把一个 ENC 文件拆给你看
c++·数据可视化
迷茫、Peanut2 小时前
中断的时钟
c++
2402_882893863 小时前
用哈希表封装 unordered_map 和 unordered_set —— 手撕 C++ 哈希容器
c++·哈希桶·unordered_map·unordered_set
熊猫钓鱼>_>3 小时前
用 OHAudioSuite 空间渲染节点搭一座「3D 有声博物馆」——从三种模式到 FreeBuds 头追的实战记录
c++·3d·ai·harmonyos·arkts·audio·ohaudiosuite
_约书亚_3 小时前
chapter 9 高级线程管理 — 归纳总结
c++