boost 版本:1.53.0
编译环境: windows 2008 -64bit
编译工具: visual stutio 2010
1.生成 bjam.exe b2.exe
运行bootstrap.bat
2.生成boost库
打开Visual Studio x64 Win64 Command Prompt (2010) 【在visual stutio tools下】
执行
bjam --toolset=msvc-10.0 architecture=x86 address-model=64 --with-system --with-thread --with-date_time --with-filesystem --with-serialization --with-chrono --variant=debug
生成64bit库的关键选项:
address-model=64
会在 boost目录的stage目录下生成上述库
参数解释:
--build-dir= <builddir> | 编译的临时文件会放在builddir里(这样比较好管理,编译完就可以把它删除了) |
--stagedir= <stagedir> | 存放编译后库文件的路径,默认是stage |
--build-type= complete | 编译所有版本,不然只会编译一小部分版本(确切地说是相当于:variant=release, threading=multi;link=shared|static;runtime-link=shared) |
variant= debug|release | 决定编译什么版本(Debug or Release?) |
link= static|shared | 决定使用静态库还是动态库。 |
threading= single|multi | 决定使用单线程还是多线程库。 |
runtime-link=static|shared | 决定是静态还是动态链接C/C++标准库。 |
--with- <library> | 只编译指定的库,如输入--with-regex就只编译regex库了。 |
--show- libraries | 显示需要编译的库名称 |
tips:
The “lib” prefix is for static libraries. Use link=static
The ‘s’ letter is to static linking to runtime. Use runtime-link=static
The ‘d’ is debug, use variant=debug
The ‘g’ is using debug runtime, I think it’s included in ‘debug’ variant