编译Boost 详细步骤 适用 VC6 VS2003 VS2005 VS2008 VS2010

VScode CMake 编写 Boost Asio 程序----记录4 项目场景: 调试 boost::thread 问题描述 boost::thread链接库出问题 参考: 1.Cmake 引用boost库时报错 Could NOT find Boost (missing: filesystem) - tututan - 博客园 2.boost库生成文件命名和编译(转载)_dragoo1的博客-CSDN博客 [main] Building folder: server [build] Starting build [proc] Executing ... 阅读详情

vs2008编译boost

 

【一、Boost库的介绍】

Boost库是一个经过千锤百炼、可移植、提供源代码的C++库,作为标准库的后备,是C++标准化进程的发动机之一。Boost库由C++标准委员会库工作组成员发起,其中有些内容有望成为下一代C++标准库内容。在C++社区中影响甚大,其成员已近2000人。 Boost库为我们带来了最新、最酷、最实用的技术,是不折不扣的“准”标准库。

   Boost库中比较有名的几个库:

   (1)Regex,正则表达式库;

   (2)Spirit,LL parser framework,用C++代码直接表达EBNF;

   (3)Graph,图组件和算法;

   (4)Lambda,在调用的地方定义短小匿名的函数对象,很实用的functional功能;

   (5)concept check,检查泛型编程中的concept;

   (6)Mpl,用模板实现的元编程框架;

   (7)Thread,可移植的C++多线程库;

   (8)Python,把C++类和函数映射到Python之中;

   (9)Pool,内存池管理;

   (10)smart_ptr,智能指针。

 

 

【二、Boost库的编译】

【Setp1 准备工作】:

(1)Boost 下载可以到官方网站下载:

http://www.boost.org/

 

(2)安装VS2008 IDE

 

 

【Setp2 编译Boost】

1.打开Visual Studio 2008 命令提示窗口

2.进入D:/05_Computer/04_3rdPatry/02Boost/boost_1_44_0/boost_1_44_0/tools/jam/src

3.执行 build.bat 会在D:/05_Computer/04_3rdPatry/02Boost/boost_1_44_0/boost_1_44_0

/tools/jam/src/bin.ntx86 生成 bjam.exe文件.

4.Copy bjam.exe 文件到 D:/05_Computer/04_3rdPatry/02Boost/boost_1_44_0/boost_1_44_0 

6.进入D:/05_Computer/04_3rdPatry/02Boost/boost_1_44_0/boost_1_44_0 目录

7.执行bjam.exe 编译命令,如下:

 

 

(1)编译所有boost动态库 release|debug),包括头文件和库文件

bjam --toolset=msvc-9.0 --prefix=D:/05_Computer/04_3rdPatry/02Boost/boost_1_44_0/output --without-python --build-type=complete  link=shared  threading=multi install

 

(2)只编译 release 版本 regex 动态库,包括头文件和库文件

bjam --toolset=msvc-9.0 --prefix=D:/05_Computer/04_3rdPatry/02Boost/boost_1_44_0/output1 --with-regex link=shared threading=multi variant=release runtime-link=shared  install

 

(3)只编译 release 版本 regex 动态库,包括库文件

bjam --toolset=msvc-9.0

--stagedir=D:/05_Computer/04_3rdPatry/02Boost/boost_1_44_0/output2

--with-regex link=shared  threading=multi variant=release runtime-link=shared  stage

 

 

【注意】: Boost 源代码所在路径最好全英文,不要有空格、特殊字符、中文等

 

编译要花上30分钟左右(根据PC性能所定), 会在指定生成目录:

D:/05_Computer/04_3rdPatry/02Boost/boost_1_44_0/output下生成对应库文件和头文件。

 

8.设置开发环境

打开VS2008 创建工程, 配置工程属性

设置包含文件目录F:/Develop/BoostlibAndDll/include/boost-1_37/boost

设置引用文件目录:F:/Develop/BoostlibAndDll/lib

完成后,可以使用。

 

 

【三、介绍Bjam使用】

Usage:

Bjam  [options]  [properties]  [install|stage]

 

 

install                 Install  headers and compiled library files to the

=======               configured locations (below).

                      在“--prefix=”指定的目录下生成所有头文件

           boost源代码下boost文件夹下所有文件)和指定库文件

 

--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=<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 the single

                     "release" version of the libraries. This

                     release corresponds to specifying:

                     "release  <threading>multi  <link>shared

                     <link>static  <runtime-link>shared" as the

                     Build variant to build.

                     complete - Attempts to 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 (default) - Names of boost

                     binaries include the Boost version

                     number and the name and version of the

                     compiler. Boost headers are installed

                     in a subdirectory of <HDRDIR> whose

                     name contains the Boost version number.

 

                     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.

 

--buildid=ID                    Adds the specified ID to the name of built

                        libraries. The default is to not add anything.

 

--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.

                                                        msvc-6.0 :  VC6.0

msvc-7.0:  VS2003

                                                        msvc-8.0:  VS2005

                                                        msvc-9.0:  VS2008

                                                        msvc-10.0:  VS2010

 

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.

                         决定是静态还是动态链接C/C++标准库

 

 

Bjam 选项、参数说明

--build-dir=<builddir>

编译的临时文件会放在builddir里(编译完就可以把它删除了)

--stagedir=<stagedir>

存放编译后库文件的路径,默认是stage

--build-type=complete

编译所有版本,不然只会编译一小部分版本(相当于:
variant=release,threading=multi;
link=shared|static;runtime-link=shared

variant=debug|release

决定编译什么版本(Debug or Release)

link=static|shared

决定使用静态库还是动态库

threading=single|multi

决定使用单线程还是多线程库

runtime-link=static|shared

决定是静态还是动态链接C/C++标准库

--with-<library>

只编译指定的库,如输入--with-regex就只编译regex库了

--show-libraries

显示需要编译的库名称

 

 

 

【四、Bjam 生成文件的分析】

 

(1)生成 Release 版本,多线程,动态链接C++标准库 的regex 动态库

bjam --toolset=msvc-9.0

 --stagedir=D:/05_Computer/04_3rdPatry/02Boost/boost_1_44_0/output2

--with-regex   link=shared  threading=multi  variant=release  runtime-link=shared  stage

 

-- 输出: boost_regex-vc90-mt.lib

boost_regex-vc90-mt-1_44.lib

                boost_regex-vc90-mt-1_44.dll

 

 

(2)生成 Release 版本,多线程,静态链接C++标准库 的regex 动态库

bjam --toolset=msvc-9.0

 --stagedir=D:/05_Computer/04_3rdPatry/02Boost/boost_1_44_0/output2

--with-regex   link=shared  threading=multi  variant=release  runtime-link= static  stage

 

-- 输出: 没有这种配置

 

 

(3)生成 Release 版本,多线程,动态链接C++标准库 的regex静态库

bjam --toolset=msvc-9.0

 --stagedir=D:/05_Computer/04_3rdPatry/02Boost/boost_1_44_0/output2

--with-regex   link= static  threading=multi  variant=release  runtime-link=shared  stage

 

-- 输出: libboost_regex-vc90-mt-s.lib

libboost_regex-vc90-mt-1_44.lib

 

 

 

(4)生成 Release 版本,多线程,静态链接C++标准库 的regex 静态库

bjam --toolset=msvc-9.0

 --stagedir=D:/05_Computer/04_3rdPatry/02Boost/boost_1_44_0/output3

--with-regex  link=static  threading=multi  variant=release  runtime-link=static  stage

 

-- 输出:libboost_regex-vc90-mt-s.lib

libboost_regex-vc90-mt-s-1_44.lib

 

 

 

--------------------------------------------------------------------------------------------------------------------

 

(1)生成 Debug 版本,多线程,动态链接C++标准库 的regex 静态库

bjam --toolset=msvc-9.0

 --stagedir=D:/05_Computer/04_3rdPatry/02Boost/boost_1_44_0/output4

--with-regex  link=static  threading=multi  variant=debug runtime-link=shared  stage

 

-- 输出: libboost_regex-vc90-mt-gd.lib

libboost_regex-vc90-mt-gd-1_44.lib

 

 

 

(2)生成 Debug 版本,多线程,静态链接C++标准库 的regex 静态库

bjam --toolset=msvc-9.0

 --stagedir=D:/05_Computer/04_3rdPatry/02Boost/boost_1_44_0/output5

--with-regex   link=static  threading=multi  variant=debug  runtime-link=static  stage

 

-- 输出: libboost_regex-vc90-mt-sgd.lib

libboost_regex-vc90-mt-sgd-1_44.lib

 

 

(3)生成 Debug 版本,多线程,动态链接C++标准库 的regex 动态库

bjam --toolset=msvc-9.0

 --stagedir=D:/05_Computer/04_3rdPatry/02Boost/boost_1_44_0/output5

--with-regex   link=shared  threading=multi  variant=debug  runtime-link=shared  stage

 

- 输出: boost_regex-vc90-mt-gd.lib

boost_regex-vc90-mt-gd-1_44.lib

         boost_regex-vc90-mt-gd-1_44.dll

 

 

(4)生成 Debug 版本,多线程,静态链接C++标准库 的regex动态库

bjam --toolset=msvc-9.0

 --stagedir=D:/05_Computer/04_3rdPatry/02Boost/boost_1_44_0/output5

--with-regex   link=shared  threading=multi  variant=debug  runtime-link=static  stage

 

-- 输出:没有这种配置

 

 

【总结】:

(1)       编译成功后,Bjam 都会给你生成一对一样的导入库文件或者静态库文件(如下),

唯一不同的是两个文件名称一个在后面加上了boost版本信息, 为了让用户知道使用的boost的版本信息。

 

 boost_regex-vc90-xxxxx.lib

 boost_regex-vc90-xxxxx-1_44.lib

 

(2)       Bjam编译选项 有4个, 理论上应该有 2*2*2*2 = 16 种配置

ink= static| shared 

threading= single |multi  

variant=release|debug  

runtime-link= static |shared

 

实际使用的多为多线程, 所以 threading= multi, 这样剩下的3个选项组成的编译配置就是上面所罗列的, 其中静态链接C++标准库的boost动态库这种配置也不存在, 所以就只有4种情况。

 

(3)

          link= static : 静态库。 生成的库文件名称以 “lib”开头

link= shared : 动态库。生成的库文件名称无“lib”开头

 

threading= mult : 支持多线程。 生成的库文件名称中包含 “-mt”

 

variant=release  生成的库文件名称不包含 “-gd”

variant= debug  生成的库文件名称包含 “-gd”

 

runtime-link= static  生成的库文件名称包含 “-s”

runtime-link= shared  生成的库文件名称不包含 “-s”


转载自:http://blog.chinaunix.net/uid-22301538-id-3158997.html

UR机械臂正逆运动学解析:从DH参数到8组解的完整求解策略 本文深入解析UR机械臂的正逆运动学求解策略,从DH参数原理到完整的8组解求解方法。详细介绍了正运动学的坐标变换过程,以及逆运动学中Atan2函数和三角恒等变换的应用,并揭示了8组解的产生机制。通过实际案例和调试技巧,帮助工程师掌握UR机械臂运动学求解的核心技术。 阅读详情

相关推荐

从零搭建openEuler ARM64开发测试环境:手把手教你用libvirt+KVM配置虚拟机(含VNC远程安装)

本文详细介绍了如何在ARM64平台上从零搭建openEuler开发测试环境,涵盖libvirt和KVM配置虚拟机的完整流程,包括环境准备、存储配置、网络优化、XML配置详解以及VNC远程安装。特别针对华为欧拉(openEuler)系统进行了优化,帮助开发者快速构建高效的ARM架构虚拟化环境。

weixin_30545945的博客 565

编译和使用boost 1.75版本

随着时间向前推进,来到今天,boost库已经发布到最新的1.76.0版本。为了安全起见,目前还是使用1.75.0版本。 以下就是基于1.75.0的版本来进行编译和测试,开发工具使用windows 10平台的VC2017社区版本。 首先我们回来到下面这个网站: 然后找到对应的版本下载,这里下载的是boost_1_75_0.7z版本,如果想快速地下载,可以使用迅雷来下载,可以几秒钟就下载完成了。 接着使用解压工具解压到目录D:\kangjin\TestBoost\boost_1_75_0, 然后我们.

大坡3D软件开发 1479

C++ boost库教程(四):windows下编译boost

前面介绍的一些boost库功能,都是boost的基础功能,boost还有很多功能需要编译后才能使用。例如Chrono, Context, FileSystem, Regex(正则表达式),Thread等。编译boost库很简单,步骤如下: (1)在cmd窗口下,cd到boost的目录,例如的目录如下: (2)执行批处理脚本 bootstrap.bat, 完成后会在当前目...

琅嬛福地 2587

boostvs2017下编译(64/32bit)

下面文章是vs2015编译, 将140换为141,则可以编译vs2017用.   编译并使用boost库(win7+boost1.63+vs2015+32位or 64位) 标签: windowsboost1.63vs6432 2017-04-15 22:02 752人阅读 评论(0) 收藏 举报  分类: c、c++(43)

rocklee的专栏 1万+

Boost编译指南

Boost 是一个开源的 C++ 库集合,提供了许多高质量的库,涵盖了许多不同的领域,如智能指针、多线程编程、正则表达式、数学库等等。Boost 的目标是提高 C++ 程序员的生产力和代码质量,同时遵循现代 C++ 的最佳实践。Boost 库是由一些 C++ 标准委员会成员创建和维护的,因此 Boost 中的一些组件被认为是 C++ 标准库的前身。Boost 库在 C++ 标准化之前提供了很多常用的工具,因此被广泛地应用于各种开源和商业项目中。

Jelin’s Blog 1万+

【翠字营原创】编译Boost 详细步骤 适用 VC6 VS2003 VS2005 VS2008 VS2010

vs2008编译boost【一、Boost库的介绍】Boost库是一个经过千锤百炼、可移植、提供源代码的C++库,作为标准库的后备,是C++标准化进程的发动机之一。 Boost库由C++标准委员会库工作组成员发起,其中有些内容有望成为下一代C++标准库内容。在C++社区中影响甚大,其成员已近2000人。 Boost库为我们带来了最新、最酷、最实用的技术,是不折不扣的“准”标准库。   Boost库中比较有名的几个库:   (1)Regex,正则表达式库;   (2)Spirit,LL parser fram

xucuiping_的专栏 5762

boost编译

Boost库的编译 Boost库本身不用多介绍,每个用C++的人都对它有或多或少的概念。尽管它存在着是否过度设计、是否学院派这类的争论,不过作为C++标准库的后备它的优秀是谁也否认不了的。下面是网上摘录的一段: ·        这世上总会有一些智慧让你吃惊。Boost就是这样的东西。 ·        Boost没有修改C++的任何规则。它是一个完全符合C++规范的代码库。 对于大部

628

Boost库学习笔记(1)—— 安装编译

一、概述         Boost是免费的可移植的C++开源库。 Windows平台构建流程 类Unix平台(例如:Linux、MacOS)构建流程 二、构建方式         如何构建Boost库呢?大部分情况下,并不需要构建,因为大多数的Boost库都仅使用头文件(.hpp):它们完全由包含模板和内联函数的头文件组成,不需要单独编译库二进

hezhanran的博客 1万+

boost_system-vc170-mt-gd-x64-1_83.lib (vc170, detected vc143, set Boost_COMPILER to override)

but it set boost_system_FOUND to FALSE so package "boost_system" is considered to be NOT FOUND. Reason given by package: No suitable build variant has been found. The following variants have been tried and rejected: * boost_system-vc170-mt-gd-x64-1_8

本博客仅供免费阅读,不提供咨询服务。请勿私信。 339

Boost库的编译

vsomeip开发之boost库的交叉编译

yhcasey的博客 3255

boost库的编译、裁剪及使用(以regex类为例)

本文将介绍如何编译、裁剪 boost 库,以及裁剪后如何使用。

程序猿-阿松的博客 2203

基于51单片机的电压表(1路,TLC1543,LCD1602)proteus、原理图、流程图、物料清单、仿真图、源代码

基于51单片机的电压表(1路,TLC1543,LCD1602)proteus、原理图、流程图、物料清单、仿真图、源代码基于51单片机的电压表(1路,TLC1543,LCD1602)基于89C51的数字电压表设计,实现一款高精度的数字电压表1、用LCD1602显示电压表数值。2、使用TLC1543测量输入电压值,测量精度为小数点后3位3、测量范围为0-5V

上一篇: LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏
下一篇: Linux系统下UDP发送和接收广播消息小例子
奋斗的IT青年
博客等级 码龄13年 59粉丝 94原创
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值