首先下载bjam.exe,复制到 $BOOST$ 目录下。或者自己生成bjam,打开Visual Studio 2008 命令提示窗口$BOOST$\tools\jam\src,执行 build.bat 会在$BOOST$\tools\jam\src\bin.ntx86 生成 bjam.exe 文件。复制文件 bjam.exe 文件到 $BOOST$\下。 1.完全编译安装: 2.只编译相应的库文件 3.查看需要编译才能使用的库列表 4.编译特定的库,如只编译regex 5.不编译某个库,如不编译regex 6.编译特定的库,如只编译regex,生成debug,多线程,共享连接版本,并保存在stage。 7.生成 mt-sgd 的静态库(runtime-link-static) 8.编译regex库。 boost的安装方法: 对于DLL版本 对于lib版本
# ------------------- # Configure msvc (default version, searched for in standard locations and PATH). # Configure specific msvc version (searched for in standard locations and PATH). #在这里添加 vs2008 的配置 using msvc : 9.0 : : /wd4819 /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 ; #在这里添加 vs2005 的配置 using msvc : 8.0 : : <compileflags>/wd4819 <compileflags>/D_CRT_SECURE_NO_DEPRECATE <compileflags>/D_SCL_SECURE_NO_DEPRECATE <compileflags>/D_SECURE_SCL=0 ; 然后进入 $BOOST$ 目录,执行bjam.exe 编译命令 //下面的命令的各选项的说明: bjam 命令说明
Boost.Build V2 (Milestone 12) Project-specific help: Project has jamfile at Jamroot Usage: bjam [options] [properties] [install|stage] Builds and installs Boost. Targets and Related Options: install Install headers and compiled library files to the --prefix=<PREFIX> Install architecture independent files here. --exec-prefix=<EPREFIX> Install architecture dependent files here. --libdir=<DIR> Install library files here. --includedir=<HDRDIR> Install header files here. stage Build and install only compiled library files --stagedir=<STAGEDIR> Install library files here Other Options: --build-type=<type> Build the specified pre-defined set of variations minimal (default) - Builds the single complete - Attempts to build all possible --build-dir=DIR Build in this location instead of building --show-libraries Displays the list of Boost libraries that require --layout=<layout> Determines whether to choose library names versioned (default) - Names of boost system - Binaries names do not include --buildid=ID Adds the specified ID to the name of built --help This message. --with-<library> Build and install the specified <library> --without-<library> Do not build, stage, or install the specified Properties: toolset=toolset Indicates the toolset to build with. 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 Configuration help: Configuration file at $boost$\tools\build\v2 This file is used to configure your Boost.Build installation. You can modify http://boost.org/boost-build2/doc/html/bbv2/reference.html#bbv2.reference.init for documentation about possible permanent locations. General command line usage: bjam [options] [properties] [targets] Options, properties and targets can be specified in any order. * --clean Remove targets instead of building Further Help: The following options can be used to obtain additional documentation. * --help-options Print more obscure command line options. 编译所有版本: bjam --toolset=msvc-8.0 --prefix=$lib-and-dll-out-dir$ --build-type=complete install 设置开发环境: 打开VS2005 选择 工具->选项->vc++目录 |
VS2008下BOOST编译指南
最新推荐文章于 2022-08-21 09:34:27 发布
许多新人对于编译BOOST感到无从下手,甚至因此而放弃使用BOOST,那真的太可惜了,下面我把一些常用的BOOST编译方法贴于此,同时也作为自己的笔记。