Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I was trying to build Boost library from source for MinGW. The Boost website says no guarantee but there seem to be people done it successfully. However I couldn't find much instructions on the web.

I updated the title to better reflect my problem right now.

======================== Original post ==============================

I downloaded Boost 1.53.0, unzipped it and cd to the folder in MinGW shell. It failed at the very first step I tried:

$ ./bootstrap.sh mingw
Building Boost.Build engine with toolset gcc...
Failed to build Boost.Build build engine
Consult 'bootstrap.log' for more details

Inside the bootstrap.log the errors are:

builtins.c:33:23: fatal error: sys/wait.h: No such file or directory
compilation terminated.
execunix.c:17:26: fatal error: sys/resource.h: No such file or directory
compilation terminated.
fileunix.c:98:17: fatal error: ar.h: No such file or directory
compilation terminated.

Please help! Thanks!

================== End of original and beginning of update =====================

Update: I found this detailed instruction on line: http://vijay.axham.com/blog/478/building-boost-binaries-on-mingw

I followed it along and now got stuck in the final build step that is supposed to take a long time but I got an error instead:

$ b2  --build-dir=$BOOST_BUILD_DIR --prefix=$BOOST_INSTALL_DIR toolset=gcc variant=release link=static threading=multi runtime-link=static install 2>&1 | tee $BOOST_BUILD_DIR/build.log
error: Unable to find file or target named
error:     'boost/tr1/tr1/bcc32'
error: referred from project at
error:     '.'

but the directory is there (it should be since it's just extracted from the zip file)

$ ls boost/tr1/tr1/bcc32/
array.h  random.h  regex.h  tuple.h  type_tra.h  unordere.h

Getting closer but still need help! Thanks!

share|improve this question
add comment

3 Answers

Do not use bash. Build it using cmd.exe.

bootstrap.bat gcc

Compiler executable should be on PATH.

share|improve this answer
    
Thank you! Is there a more detailed instruction? Something like this: vijay.axham.com/blog/478/building-boost-binaries-on-mingw ? Is the procedure more or less the same that there are one bootstrap step and two b2 steps? –  astackdummy Jun 8 '13 at 12:54
add comment
up vote 2 down vote accepted

OK I got it working. The trick was to download the tar.bz2 file, not the zip file from sourceforge (specifically http://sourceforge.net/projects/boost/files/boost/1.53.0/). Even though both the zip and the tar.bz2 files are listed under the same file folder for the same version of Boost, the contents are different. There are some missing folders in the zip file, and the line ending conventions of the compressed files are different. At any rate after I downloaded and extracted the tar.bz2 file. I followed the instructions given here:

http://vijay.axham.com/blog/478/building-boost-binaries-on-mingw

and successfully built the Boost library from source using MinGW shell (mintty to be exact). There were some failures but probably not important: has_icu_test, has_iconv, has_icu_obj, has_icu64_obj, .masm. At the end it says

...failed updating 2 targets... ...skipped 3 targets... ...updated 10623 targets...

Hope this will help others in the future.

share|improve this answer
    
Glad to see that my blog post was helpful to someone --Cheers. –  Vijay Varadan Jul 2 '13 at 21:01
add comment

Like said above, but more specifically for me compiling boost-1.54 with gcc-mingw-4.8.1

Using a Windows shell (cmd.exe) navigate to root of boost directory directory then

bootstrap.bat gcc
b2.exe toolset=gcc
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.