Build Boost 1.45 using MinGW

2019-05-06 12:40发布

问题:

Try to compile Boost 1.45 on Windows XP using MinGW. I did it a year ago and almost forgot how to repeat it.

%PATH% contains MinGW path.
user-config.jam contains using gcc ;
bjam (the ntx86 one) from here.

Output:

<path> > bjam --build-dir="E:\Boost" --build-type=complete toolset=gcc stage

<path>/tools/build/v2/build\configure.jam:145: in builds-raw
*** argument error
* rule UPDATE_NOW ( targets * : log ? : ignore-minus-n ? )
* called with: ( <pbin.v2\libs\regex\build\gcc-mingw-4.4.1\debug>has_icu.exe :  : ignore-minus-n : ignore-minus-q )
* extra argument ignore-minus-q
(builtin):see definition of rule 'UPDATE_NOW' being called
<path>/tools/build/v2/build\configure.jam:179: in configure.builds
<path>/tools/build/v2/build\configure.jam:216: in object(check-target-builds-worker)@409.check

回答1:

To build bjam using MinGW use:

bootstrap.bat mingw

This compiled version of bjam worked for me.



回答2:

The easiest way to build boost with MinGW is to use MSYS. Follow the instructions on this page to setup MSYS and mount the boost directory:

http://www.mingw.org/wiki/msys

Then just issue your bjam command as usual from within MSYS.



回答3:

BJam is included within the Boost release in \tools\build\v2\engine\src. Don't make the mistake I did and try to use the separate download of BJam - that doesn't work.



回答4:

After a lot of research, I got it to work and wrote up a step by step tutorial here:

http://petrkout.com/windows-2/compile-c-boost-libraries-in-windows-7-using-mingw32-and-masm32/

I hope this helps.



回答5:

Downloaded previous release of Boost - 1.44. The same bjam (3.1.18-1-ntx86) with Boost 1.44 works just great.



回答6:

./bootstrap.sh --with-toolset=mingw --prefix=/pathtomingw

worked for me