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
相关推荐
Yingye Zhu(HPXXZYY)22 分钟前
Codeforces 2021 C Those Who Are With Us
数据结构·c++·算法
liulilittle1 小时前
LinkedList 链表数据结构实现 (OPENPPP2)
开发语言·数据结构·c++·链表
无聊的小坏坏2 小时前
三种方法详解最长回文子串问题
c++·算法·回文串
山河木马2 小时前
前端学习C++之:.h(.hpp)与.cpp文件
前端·javascript·c++
2401_891957312 小时前
list的一些特性(C++)
开发语言·c++
米饭「」3 小时前
C++AVL树
java·开发语言·c++
心愿许得无限大3 小时前
Qt 常用界面组件
开发语言·c++·qt
GiraKoo4 小时前
【GiraKoo】C++17的新特性
c++
Rockson4 小时前
C++如何查询实时贵金属行情
c++·api
shenyan~4 小时前
关于 c、c#、c++ 三者区别
开发语言·c++