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
相关推荐
mit6.8241 小时前
一些C++的学习资料备忘
开发语言·c++
上去我就QWER2 小时前
深入解析Qt中的QDrag:实现灵活的拖放交互
c++·qt
ALex_zry2 小时前
深入解析gRPC C++动态反射:实现Proto消息的智能字段映射
开发语言·c++
沙威玛_LHE2 小时前
C++ 头文件:语言功能的 “模块化工具箱”(第三章)
c++
liu****2 小时前
12.线程同步和生产消费模型
linux·服务器·开发语言·c++·1024程序员节
顺顺 尼2 小时前
了解和使用多态
c++
0x00072 小时前
翻译《The Old New Thing》- 为什么 SHFormatDateTime 要接收一个未对齐的 FILETIME?
c++·windows
Pointer Pursuit3 小时前
C++——二叉搜索树
开发语言·c++
澪吟3 小时前
C++ 从入门到进阶:核心知识与学习指南
开发语言·c++
_OP_CHEN4 小时前
算法基础篇:(四)基础算法之前缀和
c++·算法·前缀和·蓝桥杯·acm·icpc·算法竞赛