原文转自 http://m.blog.csdn.net/article/details?id=42265605

bjam.exe stage --toolset=msvc-12.0 --without-graph --without-graph_parallel --without-math --without-mpi --without-serialization --without-wave --without-test --without-program_options --without-serialization --without-signals --stagedir="vc12_x86" link=static runtime-link=shared threading=multi debug release
#toolset:指定编译器,可选的如borland、gcc、msvc(VC6)、msvc-10.0(VS20010)
#vs2008 : msvc-9.0,vs2010 : msvc-10.0, VS2012、VS2013是msvc-12.0
#stagedir:表示编译生成文件的路径。
#build-dir:编译生成的中间文件的路径。这个本人这里没用到,默认就在根目录(D:\boost\boost_1_57_0)下,目录名为bin.v2(删掉),等编译完成后可将这个目录全部删除(没用了),所以不需要去设置。
#without/with:选择不编译/编译哪些库。
#address-model:要有address-model=64属性,如果没有这个属性的话,会默认生成32位的平台库,加入这个选项才能生成64位的DLL。
#threading:单/多线程编译。一般都写多线程程序,当然要指定multi方式了;如果需要编写单线程程序,那么还需要编译单线程库,可以使用single方式。
#静态库版link=shared,动态库link=shared
#runtime-link:动态/静态链接C/C++运行时库。同样有shared和static两种方式,这样runtime-link和link一共可以产生4种组合方式,各人可以根据自己的需要选择编译。一般link只选static的话,只需要编译2种组合即可,即link=static runtime-link=shared和link=static runtime-link=static。
#debug/release:编译debug/release版本。一般都是程序的debug版本对应库的debug版本,所以两个都编译。
#64位编译:
从开始菜单启动Visual Studio 2013的vs2013 x64兼容工具命令行,然后转到boost根文件夹,运行bootstrap.bat生成x64版的bjam.exe。
在编译命令中加入address-model=64属性
#还有人总结windows下boost库的命名特点:
link=static runtime-link=static 得到 libboostxxxxx.lib
link=shared runtime-link=shared 得到 boostxxxx.lib 和 boostxxxx.dll
由以上的文件夹层次结构基本就可以得出结论:
1、以“lib”开头的是“link-static”版本的,而直接以“boost”开头的是“link-shared”版本的。
2、有“d”的为debug版本,没有的则是release版本。
3、有“s”的为“runtime-link-static”版本,没有的则是“runtime-link-shared”版本。
4、有“mt”的为“threading-multi”版本,没有的则是“threading-single”版本。
#设定vs2013环境。
(在项目-->右键属性-->C/C++)附加包含目录:如:F:/boost_1.57_0
链接器:附加库目录:(编译生成文件的路径)如:F:/boost_1.57_0/stage/bin
附加依赖项:(项目所需编译库)
如果编译成Debug则包含:libboost_regex-vc120-mt-gd-1_57.lib(举例)
如果编译成Release则包含:libboost_regex-vc120-mt-1_57.lib

或者添加#pragma comment(lib, "libboost_regex-vc120-mt-gd-1_57.lib")附加链接库

#define BOOST_LIB_DIAGNOSTIC

它可以让VC在编译时的output窗口中输出程序具体链接了哪些boost库以及链接顺序。

测试一下:

#include "stdafx.h"
#include <boost/regex.hpp>
#include <boost/asio.hpp>
#include <iostream>
#pragma comment(lib, "libboost_date_time-vc120-mt-gd-1_57.lib")
#pragma comment(lib, "libboost_system-vc120-mt-gd-1_57.lib") int _tmain(int argc, _TCHAR* argv[])
{
boost::regex reg("[0-9]+");//lib库在项目附加依赖项中添加了
std::cout << boost::regex_match("123", reg) << std::endl;
boost::asio::io_service io;
system("PAUSE");
return 0;
}

第一次编译配置boost库成功,记录一下。开始boost之旅吧!

bjam.exe 各个参数(转)的更多相关文章

  1. 在C#中调用另一个应用程序或命令行(.exe 带参数)<zz>

    在.net中使用system.diaglostics.Process可以用来调用另一个命令行或程序. using   System.Diagnostics;     如果是dos     Proces ...

  2. 关于exe文件传递参数方法

    段代码手工折叠 {$REGION 'Designer Managed Code'} ............ {$ENDREGION} 昨天同事问到,delphi里exe文件如何传递参数? 因为手头装 ...

  3. Batch批处理 间断向EXE发送参数

    参考:https://blog.csdn.net/wjz1029/article/details/45044033 找了很久的一种方法: 怎样向一个EXE 发送一个参数,得到反馈后,再向EXE发送一个 ...

  4. ajaxmin.exe 命令参数

    这个工具用来压缩JS和CSS文件的,可去掉多余空格,换行,还修改函数名变得难以读取等. 下载这工具,下载之后是一个.msi文件可以安装.安装之后在命令行里操作即可 (下载地址和文档) http://a ...

  5. CommandLineToArgvW调EXE传入参数【转载】

    #include <afxwin.h>  // TODO: add your code here LPWSTR *szArglist = NULL; ; szArglist = Comma ...

  6. WPF应用程序exe接收参数

    using System;using System.ServiceProcess; namespace GoShopService{    public partial class Service1 ...

  7. cmd.exe启动参数详解

    https://blog.csdn.net/moonhillcity/article/details/53039763 各个系统中打开文件的命令 "windows系统: cmd " ...

  8. vb.net winform exe 接参数

    找到如下文件 -\WindowsApplication1\My Project\Application.Designer.vb <Global.System.Diagnostics.Debugg ...

  9. BOOST编译方法

    Windowsbjam --toolset=msvc-9.0 --prefix=C:\vc9_boost\vc9 --build-type=complete link=static threading ...

随机推荐

  1. 什么是redis缓存穿透, 缓存雪崩, 缓存击穿

    什么是redis? redis是一个非关系型数据库,相对于其他数据库而言,它的查询速度极快,且能承受的瞬时并发量非常的高.所以常常被用来存放网站的缓存,以减少主要数据库(如mysql)的服务器压力. ...

  2. Qt中修改QtoolTip的样式

    Qt中的QtoolTip有几个需要注意的: 1.不能直在堆或栈中生成QToolTip对象.因为其构造函数为私有.2.从widget获取的tooltip不是tooltip对象,而是tooltip中的文本 ...

  3. codeforces 258D DP

    D. Little Elephant and Broken Sorting time limit per test 2 seconds memory limit per test 256 megaby ...

  4. 问题 B: 分组统计

    分组统计 问题 B: 分组统计时间限制: 1 Sec 内存限制: 32 MB 提交: 416 解决: 107 [提交][状态][讨论版][命题人:外部导入] 题目描述 先输入一组数,然后输入其分组,按 ...

  5. poj1142 Smith Numbers

    Poj1142 Smith Numbers Smith Numbers Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 13854 ...

  6. JVM垃圾回收原理

    原文地址:http://chenchendefeng.iteye.com/blog/455883 一.相关概念 基本回收算法 1. 引用计数(Reference Counting) 比较古老的回收算法 ...

  7. 在MAC下使用Robotframework+Selenium2【第一枪】robotframework安装步骤

    最近使用苹果的MAC Pro本本,感受着苹果系统的新鲜,确实让我手忙脚乱一阵,毕竟使用windows系统太长时间了,刚开始用MAC Pro确实感觉别扭,用了一段,发现MAC系统还不错,好了,转入正题. ...

  8. 【Letter Combinations of a Phone Number】cpp

    题目: Given a digit string, return all possible letter combinations that the number could represent. A ...

  9. PostgreSQL 行排序详解

    在查询生成输出表之后,也就是在处理完选择列表之后,你还可以对输出表进行排序. 如果没有排序,那么行将以不可预测的顺序返回(实际顺序将取决于扫描和连接规划类型和在磁盘上的顺序, 但是肯定不能依赖这些东西 ...

  10. 练习题 - js函数

    代码贴出来 1 function Cat() { 2 getColor = function(){ console.log(1);} 3 return this; 4 } 5 Cat.getColor ...