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

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

相关推荐
hPw0eKIqD8 小时前
C++ 模板参数推导问题小记(非推导上下文)
开发语言·c++
程序员爱德华8 小时前
Python与C++:异同点对比
c++·python
888CC++11 小时前
C语言与C++的区别:从面向过程到面向对象
java·c语言·c++
Darkwanderor12 小时前
Linux系统编程实战项目:模拟实现shell
linux·c++
himobrinehacken13 小时前
揭秘Windows程序启动的神秘之旅
c++·安全
库玛西13 小时前
C++ 运行时多态 :核心总结与原理图解
c语言·c++·笔记
Byron Loong14 小时前
【C++】重定向是什么
开发语言·c++
hansang_IR15 小时前
【题解】LC:Z 算法(Z Algorithm)
c++·算法·字符串
霍霍的袁17 小时前
【C++】模板从入门到进阶(函数模板 + 类模板 + 特化 + 分离编译)
开发语言·c++·visual studio
海清河晏11117 小时前
Qt 实战:信号与槽+事件系统
开发语言·c++·qt