zoukankan      html  css  js  c++  java
  • bjam.exe 各个参数(转)

    原文转自 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:oostoost_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之旅吧!

  • 相关阅读:
    面试准备专题——JVM,类编译,类加载,内存错误
    面试准备-基础知识总结
    J2EE异常问题总结
    Java工具类使用注意事项
    高性能大型网站性能优化基础
    Spring Boot 2 (三):Spring Boot 开源软件都有哪些?
    Spring Boot 2(一):【重磅】Spring Boot 2.0权威发布
    Spring Boot 2 (二):Spring Boot 2 尝鲜-动态 Banner
    MFC对话框使用CPrintDialog实现打印,指定打印机、后台打印
    stm32实现iap远程固件更新
  • 原文地址:https://www.cnblogs.com/happykoukou/p/6992819.html
Copyright © 2011-2022 走看看