繁体   English   中英

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

[英]How do I build Boost.Build before compiling boost using MinGW on Windows 7?

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

因此,我下载了压缩包,将其解压缩,从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.

尽我所能的身影,我没有这些文件。 (我在任何地方的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!

我试图去寻找这些文件(或者无论如何都应该在哪里),但我什至在任何地方都找不到模块目录...所以我很困惑这个错误。 我什至无法确定这些文件是否是应该生成但由于某种原因而无法生成的生成的源文件,或者是应该已经存在且无法找到它们的文件(在后者中)情况,无论是应该将它们包含在boost源中还是应该已经存在于我的系统中。

有谁知道如何解决此错误并获得增强功能? (或者至少构建Boost.Build,这应该是构建boost的第一步...?)

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

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

这将产生b2.exe,然后可以将其用于构建Boost(的一部分)。

就我而言,由于bootstrap.bat mingwbootstrap.bat gcc都不会生成正确的project-config.jam ,即其中不包含msvc ,因此我最终在project-config.jam中将msvc手动更改为gcc 顺便说一句, mingw没有成功。

由于首次执行bootstrapb2命令(它们使用msvc12编译器部分构建了boost库),我可能会有不同的行为。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM