Compiling boost for Windows, with MinGW on Linux

Just in case you see the utter logic in developing for Windows on Linux :)

In the root of the unpacked Boost:

  1. Run ./ --with-python=$(which python2) --prefix=${HOME}/opt/boost-win --without-icu
  2. Modify project-config.jam like this:
         # file.
         if ! gcc in [ feature.values  ]
        -    using gcc ;
        +    using gcc : : i486-mingw32-g++ ;
         project : default-build gcc ;
  3. Compile and install by running ./bjam --layout=system variant=release threading=multi link=shared runtime-link=shared toolset=gcc target-os=windows threadapi=win32 install

Limit what is built by adding e.g. --with-program_options to that last command.


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>