来自 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
acc Hewlett Packard Only very recent versions are known to work well with Boost
borland Borland  
como Comeau Computing Using this toolset may require configuring another toolset to act as its backend
cw Metrowerks/FreeScale The CodeWarrior compiler. We have not tested versions of this compiler produced since it was sold to FreeScale.
dmc Digital Mars As of this Boost release, no version of dmc is known to handle Boost well.
darwin Apple Computer Apple's version of the GCC toolchain with support for Darwin and MacOS X features such as frameworks.
gcc The Gnu Project Includes support for Cygwin and MinGW compilers.
hp_cxx Hewlett Packard Targeted at the Tru64 operating system.
intel Intel  
kylix Borland  
msvc Microsoft  
qcc QNX Software Systems  
sun Sun Only very recent versions are known to work well with Boost.
vacpp IBM The 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.


原文地址:https://www.cnblogs.com/eaglezzb/p/4176497.html