如何在Windows 7上使用MinGW编译boost之前构建Boost.Build?

Dav*_*hun 1 windows boost mingw build boost-build

我正在运行Windows 7 Enterprise SP1并尝试设置C++开发环境.我安装了MinGW,这似乎可以自己正常工作.接下来,我需要安装boost ...似乎唯一不错的选择是从源代码编译.(我没有看到任何官方的Windows二进制文件.我发现了几个非官方的二进制文件,但它们往往是当前的几个版本,并且不清楚它们是否被维护.)

所以我下载了tarball,解压缩,从MinGW打开MSYS shell,转到tools/build/v2并运行bootstrap.sh - 这失败了,bootstrap.log读取如下:

###
### Using 'gcc' toolset.
###
rm -rf bootstrap
mkdir bootstrap
gcc -o bootstrap/jam0 command.c compile.c constants.c debug.c execcmd.c frames.c function.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c object.c option.c output.c parse.c pathsys.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 class.c cwd.c native.c md5.c w32_getreg.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c execunix.c fileunix.c
builtins.c:34:23: fatal error: sys/wait.h: No such file or directory
compilation terminated.
execunix.c:20:26: fatal error: sys/resource.h: No such file or directory
compilation terminated.
fileunix.c:96:17: fatal error: ar.h: No such file or directory
compilation terminated.
Run Code Online (Sandbox Code Playgroud)

尽我所能的身影,我不具备这些文件.(我在MinGW安装的任何地方都看不到它们......)接下来我尝试了bootstrap.sh --with-toolset = mingw(这似乎是一个"支持"的选项......)它似乎得到了一个在给出不同的错误之前更进一步.以下是该运行的bootstrap.log:

###
### Using 'mingw' toolset.
###
rm -rf bootstrap
mkdir bootstrap
gcc -DNT -o bootstrap/jam0 command.c compile.c constants.c debug.c execcmd.c frames.c function.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c object.c option.c output.c parse.c pathsys.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 class.c cwd.c native.c md5.c w32_getreg.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c execnt.c filent.c
./bootstrap/jam0 -f build.jam --toolset=mingw --toolset-root= clean
...found 1 target...
...updating 1 target...
...updated 1 target...
./bootstrap/jam0 -f build.jam --toolset=mingw --toolset-root=
don't know how to make modules/set.c
don't know how to make modules/path.c
don't know how to make modules/regex.c
don't know how to make modules/property-set.c
don't know how to make modules/sequence.c
don't know how to make modules/order.c
...found 126 targets...
...updating 1 target...
...can't find 6 targets...
...can't make 2 targets...
failed to write command file!
Run Code Online (Sandbox Code Playgroud)

我试图去寻找这些文件(或者它们应该在哪里),我甚至无法在任何地方找到模块目录......所以我对这个错误感到非常难过.我甚至无法确定这些是生成的源文件是否应该构建但是由于某种原因不能,或者是应该已经存在的文件而且它们找不到它们(在后者中)是否应该将它们包含在增强源中或者应该已经存在于我的系统某处.)

有谁知道如何修复此错误并获得提升?(或者至少建立Boost.Build,这应该是构建boost的第一步......?)

Jur*_*čić 5

你不应该使用MSYS shell.确保g ++.exe在路径上,并通过cmd.exe运行

d:\Libraries\Boost\boost_1_53_0>bootstrap.bat gcc

这应该产生b2.exe,然后可以用它来构建(部分)Boost.