Question

I'm running Windows 7 Enterprise SP1 and trying to set up a C++ dev environment. I installed MinGW, and that seems to be working properly on its own. Next, I need to install boost... it seems the only good option is to compile from source. (I don't see any official Windows binaries. I found several unofficial ones, but they tend to be several version behind current and it isn't clear that they're being maintained.)

So I download the tarball, extract it, open the MSYS shell from MinGW, go to tools/build/v2 and run bootstrap.sh - this fails, and bootstrap.log reads as follows:

###
### 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.

As best I can figure, I don't have those files. (I don't see them in my MinGW install anywhere...) So next I tried bootstrap.sh --with-toolset=mingw (which seems to be a "supported" option...) and it seems to get a little farther before giving a different error. Here is the bootstrap.log from that run:

###
### 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!

I tried to go looking for these files (or where they're supposed to be anyhow) and I can't even find a modules directory anywhere... so I'm pretty stumped on this error. I can't even tell for sure whether these are generated source files that it is supposed to build but can't for some reason, or are files that are supposed to already exist and it just can't find them (and in the latter case, whether they're supposed to be included with the boost source or supposed to already be on my system somewhere).

Does anyone know how to fix this error and get boost built? (or at least get Boost.Build built, which is supposed to be the first step towards building boost...?)

Was it helpful?

Solution

You shouldn't use MSYS shell. Make sure g++.exe is on path, and via cmd.exe run

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

This should produce b2.exe which can then be used to build (parts of) Boost.

OTHER TIPS

In my case, since neither bootstrap.bat mingw nor bootstrap.bat gcc generate a correct project-config.jam, i.e. which does not contain msvc, I ended up changing manually msvc to gcc in project-config.jam. By the way, mingw didn't do the trick.

I could have a different behavior due to the first execution of bootstrap and b2 commands which partially built boost libraries with msvc12 compiler.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top