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
相关推荐
wunaiqiezixin8 小时前
如何在C++中创建和管理线程
c++
雪度娃娃9 小时前
转向现代C++——在意为改写的函数添加 override
开发语言·c++
王老师青少年编程9 小时前
csp信奥赛C++高频考点专项训练之前缀和&差分 --【一维差分】:[NOIP 2018 提高组] 铺设道路
c++·前缀和·差分·csp·高频考点·信奥赛·铺设道路
星马梦缘9 小时前
aaaaa
数据结构·c++·算法
喵星人工作室10 小时前
C++火影忍者1.1.2
开发语言·c++
basketball61610 小时前
C++ 中的 ptrdiff_t 详解
开发语言·c++
wunaiqiezixin10 小时前
互斥锁与自旋锁的区别
c++
代码中介商10 小时前
深入解析STL中的stack、queue与priority_queue
开发语言·c++
磊 子12 小时前
STL无序关联容器—unorded_set+unorded_map
开发语言·c++
初夏睡觉12 小时前
数据结构学习之~二叉堆 (P3378 【模版】堆)
数据结构·c++·学习