您的位置:首页 > 其它

win10+boost for gcc

2016-04-22 14:55 162 查看
1:Download boost from boost.org

2:unzip

3:提示:cl(ml )不是内部或外部命令

需要在用户环境变量Path中添加: VS目录\vc\bin;VS目录\vc\bin\amd64_86;VS目录\common7\IDE;VS目录\common7\Tools;

4:进入解压后的目录

bootstrap.bat
gcc

5:bjam
stage --toolset=gcc --stagedir="D:\boost\boost_156_gcc" link=static runtime-link=shared runtime-link=static threading=multi
--build-type=complete

6:release版本

  bjam install --toolset=borland --prefix="E:/boost_1_38_0" release --with-date_time --with-regex

  改变的是“debug”更换为“release”。回车后开始release的boost库编译。

  bjam install --toolset=borland --prefix="E:/boost_1_38_0" debug(或release)--build-type=complete

这样会编译出所有debug和release的lib库。

  编译完成后,E:/boost_1_38_0 目录下,可以看到两个子目录:"include"和"lib",前者保存着所有采用纯头文件形式提供的boost代码文件;后者则是所有编译出的库文件。.dll, .lib

  打开C++Builder2007.

Project-Default Options-C++Builder设置。在Include Path添加前面的"include/boost-1_38"所在的目录,在Library Path添加“lib”所在的目录。

  C++Options-Paths and Directories.同上设置。

7: bjam 参数

--build-dir=<builddir> 编译的临时文件会放在builddir里(编译完就可删除)

有时不知道编译器到底需要什么版本的lib,可以完整编译boost:

VC的设置众所周知,就不说了。

--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 显示需要编译的库名称

用户环境变量
Path
中添加
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: