使用MinGW编译boost

mingw中安装boost库 首先下载并安装最新版本的mingw: http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/ 安装完成mingw后, 比如安装在C:/MinGW/下, 添加C:\MinGW\bin目录到环境变量path中。 1, 下载boost库 http://www.boost.org/ ,解压到电脑磁盘某个 阅读详情

一、Boost
Boost库是一个可移植、提供源代码的C++库,作为标准库的后备,是C++标准化进程的发动机之一。其官方网站为http://www.boost.org/,目前最新版本为1.46.0,以下以此版本为准。
Boost库大部分的子库都是C++模版提供,大部分情况下直接包含头文件就可以了。其中部分子库需要编译,如下图所示:

上图中bjam.exe是boost提供的编译工具,下面会介绍如何获得。

Windows下面使用Boost,可以下载编译好的二进制安装包,下载网址是: http://www.boostpro.com,不过目前上面提供1.44版的安装包下载,而且使用VC编译的。本文介绍如何使用Mingw编译Boost。

二、Mingw: Minimalist GNU for Windows
官方网站: http://www.mingw.org/ 部分同学可能和我一样,使用自带Mingw环境的IDE,比如Code::Blocks,其官方网站: http://www.codeblocks.org/。请确保Mingw工具链目录添加到系统的环境变量PATH中,比如我路径为:"D:\Program Files\CodeBlocks\MinGW\bin",并将这个目录下的mingw32-make.exe复制并重命名为make.exe。然后验证gcc等能否正常使用:开始->运行->输入"cmd"回车->命令窗口输出"gcc -v"查看gcc版本信息,如果看到如下类似输出,那么就可以继续正是编译Boost了。


三、bjam.exe
bjam是boost自带的工具,用来方便地编译boost,当然也可以用来编译你自己的工程。bjam在boost源码中一起提供,需要编译才能使用,下载boost的时候会提示下载一个编译好的bjam,我不是很推荐,因为我用下载来的bjam编译boost的时候,出现一些错误,而用自己编译的bjam却顺利完成。
在"E:\_Libs_\boost_1_46_0\tools\build\v2\engine\src"下,使用命令"build mingw",会在此目录下生成文件bin.ntx86\bjam.exe,将bjam.exe拷贝到boost源文件的根目录下,如"E:\_Libs_\boost_1_46_0\"。在这个目录下的"./Jamroot"文件,详细描述了bjam的用法,建议用文本打开这个文件并阅读前面部分的注释,摘抄如下:
# Usage:
#
#   bjam [options] [properties] [install|stage]
#
#   Builds and installs Boost.
#
# Targets and Related Options:
#
#   install                 Install headers and compiled library files to the
#   =======                 configured locations (below).
#
#   --prefix=<PREFIX>       Install architecture independent files here.
#                           Default; C:\Boost on Win32
#                           Default; /usr/local on Unix. Linux, etc.
#
#   --exec-prefix=<EPREFIX> Install architecture dependent files here.
#                           Default; <PREFIX>
#
#   --libdir=<DIR>          Install library files here.
#                           Default; <EPREFIX>/lib
#
#   --includedir=<HDRDIR>   Install header files here.
#                           Default; <PREFIX>/include
#
#   stage                   Build and install only compiled library files
#   =====                   to the stage directory.
#
#   --stagedir=<STAGEDIR>   Install library files here
#                           Default; ./stage
#
# Other Options:
#
#   --build-type=<type>     Build the specified pre-defined set of variations
#                           of the libraries. Note, that which variants get
#                           built depends on what each library supports.
#
#                               minimal (default) - Builds a minimal set of
#                               variants. On Windows, these are static
#                               multithreaded libraries in debug and release
#                               modes, using shared runtime. On Linux, these
#                               are static and shared multithreaded libraries
#                               in release mode.
#
#                               complete - Build all possible variations.
#
#   --build-dir=DIR         Build in this location instead of building
#                           within the distribution tree. Recommended!
#
#   --show-libraries        Displays the list of Boost libraries that require
#                           build and installation steps, then exit.
#
#   --layout=<layout>       Determines whether to choose library names
#                           and header locations such that multiple
#                           versions of Boost or multiple compilers can
#                           be used on the same system.
#
#                               versioned - Names of boost binaries
#                               include the Boost version number, name and
#                               version of the compiler and encoded build
#                               properties.  Boost headers are installed in a
#                               subdirectory of <HDRDIR> whose name contains
#                               the Boost version number.
#
#                               tagged -- Names of boost binaries include the
#                               encoded build properties such as variant and
#                               threading, but do not including compiler name
#                               and version, or Boost version. This option is
#                               useful if you build several variants of Boost,
#                               using the same compiler.
#
#                               system - Binaries names do not include the
#                               Boost version number or the name and version
#                               number of the compiler.  Boost headers are
#                               installed directly into <HDRDIR>.  This option
#                               is intended for system integrators who are
#                               building distribution packages.
#
#                           The default value is 'versioned' on Windows, and
#                           'system' on Unix.
#
#   --buildid=ID            Adds the specified ID to the name of built
#                           libraries.  The default is to not add anything.
#
#   --python-buildid=ID     Adds the specified ID to the name of built
#                           libraries that depend on Python.  The default
#                           is to not add anything. This ID is added in
#                           addition t --buildid.
#
#
#   --help                  This message.
#
#   --with-<library>        Build and install the specified <library>
#                           If this option is used, only libraries
#                           specified using this option will be built.
#
#   --without-<library>     Do not build, stage, or install the specified
#                           <library>. By default, all libraries are built.
#
# Properties:
#
#   toolset=toolset         Indicates the toolset to build with.
#
#   variant=debug|release   Select the build variant
#
#   link=static|shared      Whether to build static or shared libraries
#
#   threading=single|multi  Whether to build single or multithreaded binaries
#
#   runtime-link=static|shared     
#                           Whether to link to static or shared C and C++ runtime.
# 

四、分享
bjam  --build-type=complete toolset=gcc stage
上面的命令将编译所有需要编译的子库(除python)的各种版本,编译时间稍长,约40分钟~1小时。生成的文件在./stage/lib目录下。 不同版本可以通过名称来区别,例如date_time库一共生成有16个相关文件:
libboost_date_time-mgw44-1_46.a
libboost_date_time-mgw44-1_46.dll
libboost_date_time-mgw44-1_46.dll.a
libboost_date_time-mgw44-d-1_46.a
libboost_date_time-mgw44-d-1_46.dll
libboost_date_time-mgw44-d-1_46.dll.a
libboost_date_time-mgw44-mt-1_46.a
libboost_date_time-mgw44-mt-1_46.dll
libboost_date_time-mgw44-mt-1_46.dll.a
libboost_date_time-mgw44-mt-d-1_46.a
libboost_date_time-mgw44-mt-d-1_46.dll
libboost_date_time-mgw44-mt-d-1_46.dll.a
libboost_date_time-mgw44-mt-s-1_46.a
libboost_date_time-mgw44-mt-sd-1_46.a
libboost_date_time-mgw44-s-1_46.a
libboost_date_time-mgw44-sd-1_46.a
如上,mgw44代表编译器Mingw4.4版本:
mt: threading=multi 
s: runtime-link=static
d: variant=debug
.dll: link=shared
.dll.a: 对应DLL的导入库文件
C++: Windows下MinGW编译boost并配置Clion 1.安装MinGW: 也可以使用Qt自带的mingw 并mingw的bin目录添加到PATH 2. 安装boost: 以下2选1: 方式1:编译好的MSVC: http://dl.bintray.com/boostorg/release/ 方式2:官网未编译的Boost:https://www.boost.org/users/download/ 解压后: 文件结构说明:(来源Boost文档:https://www.boost.org/doc/libs/1_73_0/mor 阅读详情

相关推荐

使用MinGW编译Boost

1、下载Boost(http://www.boost.org) 我目前用的是1.61.0版本 2、将MinGW下的bin目录完整路径设置到系统环境变量Path中,保证cmd命令行能找到gcc,g++等命令。 3、cmd进入到boost目录下面,执行"bootstrap.bat gcc",目录下会生成一个b2.exe 4、执行b2.exe开始编译。可以根据自身需要执行不同的编译命令,比如: b2.exe stage –toolset=gcc –with-exception –with-locale –with

我不是码农的博客~~~ 1599

Mingw 编译 boost

mingw编译boost

易得者易失 1043

windows-qt 使用mingw编译c++boost并使用

一、boost是一个准标准库,相当于STL的延续和扩充,它的设计理念和STL比较接近,都是利用泛型让复用达到最大化。不过对比STL,boost更加实用。STL集中在算法部分,而boost包含了不少工具类,可以完成比较具体的工作。考虑到boost的强大,为此特地里做了windows下移植编译操作。 二、boost的移植 1.下载boost源码boost_1_62_0.7z,下载地址:https://sourceforge.NET/projects/boost/ 其实也可以下载boos编译好的库和头文件,不过为

我不是码农的博客~~~ 660

mingw编译boost动态库

MinGW首先要安装MinGW,并添加MinGW的bin路径至环境变量Path。MinGW下载地址:https://sourceforge.net/projects/mingw-w64/设置好MinGW的环境变量打开源码目录,执行bootstrap.bat批处理文件,会在目录内产生一个b2.exe文件。使用b2.exe来编译boost。

qq_43702524的博客 1116

26、Mingw32编译boost静态包/linux编译boost静态包,并使用Clion测试

基本思想:在工程中使用Clion编译器去调用boost的函数实现图形的并集处理,所以需要预先编译 一下boost库,以便可以在Clion中调用 <前提已经安装了mingw32编译器> 一、首先下载boost的源代码 首先下载最新版板的boost版本 https://www.boost.org/users/history/version_1_77_0.html 二、然后进行编译 ​ F:\sxj\20210911>cd boost_1_77_0 F:\sxj\20210911

sxj731533730 1088

boost静态库win10 mingw730_64编译

boost静态库文件; 编译环境:win10 64bit,编译器mingw730_64,静态编译; 库文件说明:mt multithread,d debug版本,x64 64位库,x32 32位库;

使用Mingw32编译boost库

本文简要描述mingw32版编译boost库。

dyw的专栏 4910

STM32驱动WS2812B实现音乐频谱可视化系统

本文详细介绍了基于STM32驱动WS2812B灯带实现音乐频谱可视化系统的设计与实现。通过FFT算法实时分析音频信号,将频谱映射到炫彩灯光控制系统,结合PWM和DMA技术实现低延迟响应。系统支持多模式切换和动态亮度调节,适用于创意灯光秀和智能家居场景。

weixin_29171129的博客 302

mingw环境下boost库的编译和使用

mingw环境下boost库的编译和使用 博客分类: 安装笔记 CC++C#GCCEclipse     首先到boost的网站上下载最新的BOOST源代码和编译好的JAM,地址:http://www.boost.org/users/download/。这里下载的是boost-jam-3.1.17-1-ntx86.zip和boost_1_37_0.tar.bz2

可克技术 1430

用Python+NumPy手把手实现分数阶傅里叶变换(FRFT),搞定线性调频信号分析

本文详细介绍了如何使用Python和NumPy实现分数阶傅里叶变换(FRFT),特别针对线性调频信号(Chirp信号)分析。通过从零开始的代码实现和可视化案例,展示了FRFT在时变信号处理中的强大能力,帮助工程师和研究人员高效分析频率随时间变化的信号。

weixin_29062823的博客 218

手把手教你用CsvView分析大疆无人机飞行日志(附实战CTF题解)

本文详细介绍了如何使用CsvView工具分析大疆无人机飞行日志,包括环境搭建、日志提取、核心功能解析及CTF实战技巧。通过实战案例,帮助读者掌握无人机取证的关键技术,提升日志分析能力,特别适合网络安全竞赛和实际取证场景。

weixin_42652674的博客 457

Windows平台MinGW GCC编译并使用C++ Boost

Windows平台MinGW GCC编译并使用C++ Boost 文章目录Windows平台MinGW GCC编译并使用C++ Boost前提编译Boost为动态链接库使用编译的Boost动态链接库编译Boost为静态链接库使用Boost静态链接库 前提 操作系统:Windows 10,安装了MinGW,并将gcc.exe等程序添加到Path变量中。 在下载好的Boost目录中运行booststr...

semicloud的专栏 1092

自动驾驶仿真(六)—— SIL软件在环仿真测试

自动驾驶仿真六—— SIL软件在环仿真测试1. 在环仿真测试2. SIL软件在环仿真测试2.1 模型配置参数2.2 S function生成实现2.3 结果对比3. 参考学习的书目教材 博主前面的博文已经简要介绍了Carsim、Prescan 与 Simulink 在 “V”型开发流程的一些应用,现今成熟的汽车控制系统软件都是以(Model Based Design,MBD)来开发,它以图形化的方式表达复杂的逻辑、代码可读性、可移植性、开发调试便利程度都大大增强,同时利用成熟的代码生成工具链,也避免了手工代

zhudj08的博客 8653

Windows下使用MinGW编译boost库

准备工作MinGW首先要安装MinGW,并添加MinGW的bin路径至环境变量Path。 MinGW下载地址:https://sourceforge.net/projects/mingw-w64/ 或:http://download.youkuaiyun.com/download/godmaycry/10143726 MinGW配置成功标志:在cmd控制台下输入gcc -v,如显示gcc版本信息,即成功。

godmaycry的专栏 6446

【图像去噪】论文精读:FM2S: Self-Supervised Fluorescence Microscopy Denoising With Single Noisy Image

论文题目:FM2S: Self-Supervised Fluorescence Microscopy Denoising With Single Noisy Image —— FM2S:单噪声图像自监督荧光显微镜去噪arXiv 2024!显微图像去噪!通过可视化详细的细胞结构和生物过程,荧光显微镜具有显着先进的生物学研究。然而,由于难以精确建模固有噪声和获取干净图像进行训练,这种图像去噪任务往往面临挑战,这限制了大多数现有方法。在本文中,我们提出了一种有效的。

主要更新底层视觉(去噪、超分等)相关的科研内容,形式为【论文精读】+【论文复现】 408

WPF在特定领域的应用:打造一款专业的图像编辑工具

WPF在特定领域的应用:打造一款专业的图像编辑工具,在软件开发的广阔领域中,Windows Presentation Foundation(WPF)以其强大的图形渲染能力和丰富的用户界面控件,为开发者提供了构建高性能、美观应用程序的平台。图像编辑工具作为一种对图形处理要求极高的应用类型,WPF 的特性使其成为理想的选择。本文将深入探讨如何使用 WPF 打造一款专业的图像编辑工具,涵盖从基础概念到实际代码实现的各个方面。

不踩坑,不知道坑有多深;不总结,踩过的坑白踩。 6万+

在Windows系统上使用MinGW-GCC编译Boost库并在VSCode中引用Boost库进行C++开发

本文介绍了在Windows系统下使用MinGW-GCC编译Boost库并集成到VSCode中的方法。主要内容包括:1)从Boost官网下载最新版本源码并解压;2)通过bootstrap.bat生成b2构建工具;3)使用b2工具编译Boost库,详细解析了install和stage两种编译目标的区别及相关路径配置选项;4)说明如何将编译好的Boost库在VSCode项目中引用。文章面向已配置好VSCode和MinGW环境的开发者,提供了完整的Boost库编译和开发环境搭建指南。

weixin_60586322的博客 2923

将Keil中的变量数组导出

首先,写好导出数据的函数。

小柚子的博客 1952

Win10使用MinGW编译和安装boost库

编译完成后,可以把E:\software\boost_build和E:\software\boost_1_70_0\build两个目录删掉,最终的boost库安装在。官网地址:https://www.boost.org/users/history/version_1_70_0.html。打开CMD命令行,然后输入g++ --version,如果正常显示版本信息,则说明MinGW环境正常,可以继续往下。目录重新打开cmd命令行窗口,这样会使新配置的环境生效。

振华OPPO的博客世界 1296

手把手教你学Simulink--FIR滤波器的设计与优化仿真

FIR滤波器的设计目标通常包括指定的频率响应特性(如低通、高通、带通或带阻),以及特定的应用需求(如线性相位、最小化误差等)。Simulink提供了一个直观且强大的平台来模拟这些设计,并允许用户通过调整参数实时观察其对系统性能的影响。明确你的系统需求,比如输入信号类型(如正弦波组合)、采样率、FIR滤波器的设计参数(如滤波器类型、阶数、截止频率等)。假设我们需要设计一个低通FIR滤波器,用来去除高于1kHz的所有频率成分,保留低于1kHz的信号成分。采样率为8kHz。

MHD0815的博客 347

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

minGw编译php,Windows下使用MinGW编译boost库

准备工作MinGWBoost编译注意: 一定要设置好MinGW的环境变量,不然必定失败。打开boost源码目录,执行bootstrap.bat批处理文件,会在目录内产生一个b2.exe文件。在目录文件夹,按住shift键+鼠标右键,选择“在此处打开PowerShell窗口”(或“在此处打开控制台窗口”),执行指令:./b2.exe --help会列出关于boost的编译选项,其主要选项如下:--p...

weixin_28278377的博客 240

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

使用mingw编译boost 1.55

2019独角兽企业重金招聘Python工程师标准>>> ...

weixin_34267123的博客 114

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

Windows环境下使用minGW编译boost库(windows下编译使用asio, thread等)

Windows环境下编译boost完整库, Windows下编译asio库

moollun的专栏 2473

Qt 应用之 MinGW编译 并使用boost库

PS:最近在使用我们的mingw qt 工程中使用 boost 的时候,需要用到一些boost 中的工具类,该类是需要通过编译,然后链接到qt中的。网上看了很多教程,有很多千篇一律的,特此提醒,能下载到的现成的不一定是能用的,倒头来还要自己摸索一遍,从头编译。 移植步骤: 1.下载boost 。 网站链接:https://www.boost.org/users/download/...

学之知之的博客 2199

Qt5.12.6编译器minGW编译boost库并使用

文章目录 简介目标阅读基础快速阅读环境说明参考资料 Qt5.12.6的编译器准备下载安装配置验证 Boost库的下载Boost库的编译打开minGW生成编译工具编译安装安装完成 Boost库添加到qt工程Boost库保存在工程下拷贝Boost库在pro文件中添加编...

我不是码农的博客~~~ 3129
上一篇: 在code::block中使用boost库
下一篇: C/C++中的日期和时间
hellosijian
博客等级 码龄16年 35粉丝 23原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值