Archive for March, 2011

Compiling boost thread using mingw64

March 5, 2011

A short note on crosscompiling boost for 64bit windows using mingw64.

First get a build of mingw64 eg. from

http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/

I did use mingw-w64-bin_i686-linux_20110206.tar.bz2 since the build system is 32bit linux.

Get a recent version of the boost libraries.
Update the path to reflect where mingw64 was put.
Unpack boost and add a corresponding definition of gcc to tools/build/v2/user-config.jam
Mine was

using gcc : mingw64 : x86_64-w64-mingw32-g++ : 4.6 ;

Then build boost with bjam.

./bootstrap.sh
./bjam --layout=versioned --tolset=gcc-mingw64 define=BOOST_USE_WINDOWS_H address-model=64 threadapi=win32 target-os=windows --with-thread stage

The define=BOOST_USE_WINDOWS_H is crucial else the compilation will fail.

Advertisements