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
相关推荐
雾岛听蓝7 分钟前
C++:模拟实现string类
开发语言·c++
XFF不秃头18 分钟前
力扣刷题笔记-合并区间
c++·笔记·算法·leetcode
编程之路,妙趣横生28 分钟前
STL(七) unordered_set 与 unordered_map 基本用法 + 模拟实现
c++
寂柒1 小时前
c++--
c++
wregjru1 小时前
【读书笔记】Effective C++ 条款3:尽可能使用const
开发语言·c++
历程里程碑2 小时前
滑动窗口秒解LeetCode字母异位词
java·c语言·开发语言·数据结构·c++·算法·leetcode
Tandy12356_2 小时前
手写TCP/IP协议栈——TCP结构定义与基本接口实现
c语言·网络·c++·网络协议·tcp/ip·计算机网络
Helibo442 小时前
2025年12月gesp3级题解
数据结构·c++·算法
西幻凌云3 小时前
初始——正则表达式
c++·正则表达式·1024程序员节
沧澜sincerely3 小时前
蓝桥杯101 拉马车
c++·蓝桥杯·stl