来自 sohu 网友 boost 1.35

1.下载boost1.35
2.解压
3.bjam
    编译bjam或下载已经编译好的bjam
    下载地址:http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=72941
    
    如果要编译则
    在windows命令行窗口下, 执行BOOST_DIR\tools\jam\src下build.bat, 编译工具bjam。
    
    格式如下:
	build [toolset] [setup*] [--option+ target*] 
    参考:http://www.boost.org/doc/libs/1_35_0/doc/html/jam/building.html
    实例如下:
        build.bat mingw --toolset-root="D:\CodeBlocks\MinGW"
    
    但在http://www.boost.org/doc/libs/1_35_0/more/getting_started/windows.html#get-bjam中,5.2.2 一节说:
    “ If you previously chose a toolset for the purposes of  building bjam , you should assume it won't work and instead choose newly from the table below. ”
    所以如果上述命令不行,编译过程出错或使用时有问题, 可以将“mingw”换成“gcc”试试。

4.编译boost
  bjam编译好后,  将BOOST_DIR\tools\jam\src\bin.ntx86中刚生成的bjam.exe拷贝到BOOST_DIR中 。这一步是必须的,不然会出错。


  在windows命令行窗口下, 执行BOOST_DIR\bjam.exe, 开始编译boost

    格式如下:

         bjam  --build-dir= build-directory   --toolset= toolset-name  stage

    其中  build directory  是编译过程中临时文件存放的地方。
    实例:

         bjam  --build-dir="G:\boost_1_35_0\build_dir"    --toolset= gcc stage

   等待........

    我最后生成的文件都是以下形式的:

    boost_date_time-mgw34-mt.lib
    boost_date_time-mgw34-mt-1_35.lib
    boost_date_time-mgw34-mt-1_35.dll

    虽然是lib格式的, 但mingw可以用,应该就是这样的吧。
    另外 boost_date_time-mgw34-mt.lib与boost_date_time-mgw34-mt-1_35.lib好像是一样的。应该任意用其中的一个。


:boost支持的编译器的标识(名字)
http://www.boost.org/doc/libs/1_35_0/more/getting_started/windows.html#get-bjam

5.2.2   Identify Your Toolset

First, find the toolset corresponding to your compiler in the following table.

Note

If you previously chose a toolset for the purposes of building bjam, you should assume it won't work and instead choose newly from the table below.

Toolset Name Vendor Notes
accHewlett PackardOnly very recent versions are known to work well with Boost
borlandBorland 
comoComeau ComputingUsing this toolset may require configuring another toolset to act as its backend
cwMetrowerks/FreeScaleThe CodeWarrior compiler. We have not tested versions of this compiler produced since it was sold to FreeScale.
dmcDigital MarsAs of this Boost release, no version of dmc is known to handle Boost well.
darwinApple ComputerApple's version of the GCC toolchain with support for Darwin and MacOS X features such as frameworks.
gccThe Gnu ProjectIncludes support for Cygwin and MinGW compilers.
hp_cxxHewlett PackardTargeted at the Tru64 operating system.
intelIntel 
kylixBorland 
msvcMicrosoft 
qccQNX Software Systems 
sunSunOnly very recent versions are known to work well with Boost.
vacppIBMThe VisualAge C++ compiler.

If you have multiple versions of a particular compiler installed, you can append the version number to the toolset name, preceded by a hyphen, e.g. intel-9.0 or borland-5.4.3On Windows, append a version number even if you only have one version installed (unless you are using the msvc or gcc toolsets, which have special version detection code) or auto-linkingwill fail.


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值