boost编译备忘

初始化linux

windows:程序员

bootstrap.batbootstrap

linux:windows

bootstart.shdom

 

 

参数ui

link=static|shared命令行

threading=single|multidebug

runtime-link=static|sharedit

--with-io

variant=debug|release

--build-type=complete 

--toolset=msvc-10.0 

 

 

address-model=64

表明编译成64位版本,如省略此项,默认为编译成32位版本。

 

 

linux编译:

./b2 --build-type=minimal --with-date_time --with-filesystem --with-program_options --with-regex --with-serialization --with-system --with-thread --with-random --with-chrono variant=release link=static threading=multi address-model=64 stage

 

 

 

window编译:

bjam.exe --build-type=minimal --with-date_time --with-filesystem --with-program_options --with-regex --with-serialization --with-system --with-thread --with-random toolset=msvc-12.0 variant=release link=static threading=multi address-model=32 stage

 

 

生成目录

--stagedir=./stage_debug 使用bcp.exe剪切boost库 一、把bjam.exe拷贝到tools/bcp 目录下,使用vs的命令行运行 bjam.exe,参数随意,无非也就是toolset选择 release/debug选择等等,没有参数也能编译成功。 二、在bin.v2/tools/bcp/...  (再后面是根据你的编译选项而生成的文件夹,如msvc-9.0/release/link-static/threading-multi)  目录下能够找到 bcp.exe。这就是咱们所须要的程序了。 三、bcp的使用是简单的,假设咱们容许程序员用A、B、C、D这样四个模块,那么咱们能够这样: bcp --boost: A B C D 这里A、B、C、D能够是: Boost的头文件名。如: boost/shared_ptr.hpp Boost的库名。如:regex Boost的头文件标题:boost/shared_ptr 或者 shared_ptr 若是是在boost根目录下,那指定boost目录的参数也能够省去。

相关文章
相关标签/搜索