如何使用CodeBlocks安装Boost库?

Gar*_*ckW 10 c++ boost codeblocks

所以我在这里结束了我的路线; 我正在研究保存文件和序列化,只是为了了解C++没有Python所具有的本机序列化能力pickle.但幸运的是,它有Boost - 所以我开始在我的系统上安装Boost 1.47,以便能够序列化我的对象.

到目前为止,没有成功.我首先想到我可以使用它:http://wiki.codeblocks.org/index.php?title = BoostWindowsQuickRef,但我不断发现版本错误不匹配,并且在尝试多次找到与1.47兼容的Boost Jam之后(我只发现1.3.19,似乎是为1.46而建的),我看到这个页面已经过了一年半了.

然后,经过多次搜索,我在此指出:http://www.boost.org/doc/libs/1_47_0/doc/html/bbv2/installation.html.但这也不起作用.运行\ bootstrap.bat时,我收到以下错误:

无法构建Boost.Build引擎.请参阅bootstrap.log以获取进一步的诊断信息.

嗯 - 好吧,没有任何类型的.log文件,但有一个名为bootstrap的文本文件,其中包含以下内容:

Setting environment for using Microsoft Visual Studio 2010 x86 tools.
###
### Using 'vc10' toolset.
###

c:\Program Files (x86)\CodeBlocks\MinGW\downloaded\boost_1_47_0\tools\build\v2\engine>if exist bootstrap rd /S /Q bootstrap 

c:\Program Files (x86)\CodeBlocks\MinGW\downloaded\boost_1_47_0\tools\build\v2\engine>md bootstrap 

c:\Program Files (x86)\CodeBlocks\MinGW\downloaded\boost_1_47_0\tools\build\v2\engine>cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib /Febootstrap\jam0  command.c compile.c debug.c execnt.c expand.c filent.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c newstr.c option.c output.c parse.c pathunix.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c md5.c pwd.c class.c w32_getreg.c native.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c 
command.c
compile.c
debug.c
execnt.c
execnt.c(29) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
expand.c
filent.c
glob.c
hash.c
hdrmacro.c
headers.c
jam.c
jam.c(581) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
jambase.c
jamgram.c
lists.c
make.c
make1.c
newstr.c
option.c
output.c
parse.c
Generating Code...
Compiling...
pathunix.c
pathunix.c(275) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
regexp.c
rules.c
scan.c
search.c
subst.c
timestamp.c
variable.c
modules.c
strings.c
filesys.c
builtins.c
md5.c
pwd.c
class.c
w32_getreg.c
w32_getreg.c(18) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
native.c
set.c
path.c
regex.c
Generating Code...
Compiling...
property-set.c
sequence.c
order.c
Generating Code...
Run Code Online (Sandbox Code Playgroud)

现在,我真的很困惑.我已经完成了所有这些 - 我仍在编写侧卷轴,并且现在只有几个月的C++能力.我不知道我做错了什么.有人能指出我一个清晰,完整的分步指南或什么?我只想把Boost加到我的系统上!

Nic*_*tti 3

从您发布的错误消息来看,我假设您正在使用某些版本的 Visual Studio。为了从命令行使用其编译器,您需要定义一些环境变量。如果您使用 Visual Studio 命令提示符,则会自动完成此操作。更好的是,您可能想尝试并遵循本教程