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

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

相关推荐
不想写代码的星星7 小时前
C++继承、组合、聚合:选错了是屎山,选对了是神器
c++
不想写代码的星星1 天前
std::function 详解:用法、原理与现代 C++ 最佳实践
c++
樱木Plus3 天前
深拷贝(Deep Copy)和浅拷贝(Shallow Copy)
c++
blasit5 天前
笔记:Qt C++建立子线程做一个socket TCP常连接通信
c++·qt·tcp/ip
肆忆_6 天前
# 用 5 个问题学懂 C++ 虚函数(入门级)
c++
不想写代码的星星6 天前
虚函数表:C++ 多态背后的那个男人
c++
端平入洛8 天前
delete又未完全delete
c++
端平入洛9 天前
auto有时不auto
c++
哇哈哈202110 天前
信号量和信号
linux·c++
多恩Stone10 天前
【C++入门扫盲1】C++ 与 Python:类型、编译器/解释器与 CPU 的关系
开发语言·c++·人工智能·python·算法·3d·aigc