boost在不同平台下的编译(win、arm)

首先下载boost源码

下载完成之后解压

前提需要自行安装gcc等工具

window

bash 复制代码
./bootstrap.sh
./b2
./b2 install

arm (linux)

powershell 复制代码
sudo ./bootstrap.sh
sudo ./b2 cxxflags=-fPIC cflags=-fPIC link=static -a threading=multi
sudo ./b2 install

x86 (linux)

powershell 复制代码
sudo ./bootstrap.sh

在boost_1_77_0/tools/build/src/tools目录下找到gcc.jam文件,打开它。在

powershell 复制代码
compile-link-flags <link>shared/<target-os>$(non-windows) : -fPIC ;

下新增一行:

powershell 复制代码
compile-link-flags <link>static/<target-os>$(non-windows) : -fPIC ;

(提示:复制前一行,修改shared为static即可)。

powershell 复制代码
sudo ./b2 cxxflags=-fPIC cflags=-fPIC link=static -a threading=multi
sudo ./b2 install

完成

boost头文件路径(以1.77为例)

powershell 复制代码
boost_1_77_0/boost

boost库文件路径(以1.77为例)

powershell 复制代码
boost_1_77_0/stage/lib
相关推荐
zmzb010319 分钟前
C++课后习题训练记录Day176
开发语言·c++
王维同学22 分钟前
跨位数进程的映像、命令行与环境块读取
c++·windows·安全
Rabitebla24 分钟前
C++ STL 之 set 详解:从底层红黑树到实际应用
开发语言·数据结构·c++·算法·leetcode
誰能久伴不乏1 小时前
深入解析 C++ STL 底层原理:从设计哲学到内存收割机
c++·架构·stl
jinyishu_1 小时前
C++继承与多态进阶
开发语言·c++·程序人生
程序猿编码1 小时前
用 C++ 从零写一个能训练的 GPT:标量自动微分 + Arena 内存池
开发语言·c++·gpt·transformer·模型推理
库玛西1 小时前
快速幂算法全景总结图:从“愚公移山”到“细胞分裂”
c语言·c++·笔记·算法
郝学胜_神的一滴1 小时前
Qt 高级编程 038:打造高颜值下拉菜单按钮
c++·qt
小鬼头编程2 小时前
信息学竞赛体系(CSP-J/S、NOIP、NOI、IOI)
c++·人工智能·青少年编程
我不是懒洋洋2 小时前
从零实现一个分布式数据管道:dbt的核心设计
c++