ARM交叉编译Boost库

Boost下载:点击跳转

编译过程:

  1. 生成project-config.jam

    ./bootstrap.sh --with-libraries=filesystem,thread --with-toolset=gcc

  2. 修改project-config.jam(位于第12行附近)

    if ! gcc in [ feature.values <toolset> ]
    {
    using gcc : arm : /opt/cluster-qt/2.5.3/sysroots/x86_64-sdrvsdk-linux/usr/bin/aarch64-sdrv-linux/aarch64-sdrv-linux-g++ --sysroot=/opt/cluster-qt/2.5.3/sysroots/aarch64-sdrv-linux ;
    }

3.执行编译

./b2 toolset=gcc-arm threading=multi link=shared

4.安装

./b2 install --prefix=$PWD/build

5、测试

复制代码
#include <iostream>
#include <boost/algorithm/string.hpp>

int main() {
    std::string str = "Hello, World!";
    boost::to_upper(str);
    std::cout << str << std::endl;
    return 0;
}

编译

复制代码
aarch64-sdrv-linux-g++ main.c -o main -Lbuild/lib/ -lboost_filesystem -lboost_thread -Ibuild/include --sysroot=/opt/cluster-qt/2.5.3/sysroots/aarch64-sdrv-linux

觉得有帮助的话,打赏一下呗。。

需要商务合作(定制程序)的欢迎私信!!

相关推荐
千里马-horse4 天前
Boost.Iostreams 简介
开发语言·c++·boost
云雾J视界5 天前
开关电源拓扑工程宝典:从原理到实战的深度设计指南
gan·boost·开关电源·1024程序员节·buck·拓扑电路
creator_Li9 天前
socket
boost
rosemary51219 天前
libboost_system-mt-x64.so.1.76.0 和libboost_system-mt-d-x64.so.1.76.0 区别
boost
xiecoding.cn1 个月前
Boost下载安装教程(附安装包,图文并茂)
boost·boost下载·boost安装·boost最新版下载·boost安装教程·boost下载安装教程
heeheeai1 个月前
决策树,随机森林,boost森林算法
算法·决策树·随机森林·kotlin·boost
自动驾驶小卡2 个月前
boost::circular_buffer的使用方法简介
c++·boost·circular_buffer
奇树谦3 个月前
踩坑记录:因版本不匹配导致 Boost 1.85 编译失败的完整解决过程
boost
卡戎-caryon6 个月前
【项目实践】boost 搜索引擎
linux·前端·网络·搜索引擎·boost·jieba·cpp-http
GOTXX7 个月前
BoostSiteSeeker项目实战
前端·c++·后端·mysql·搜索引擎·项目实战·boost