Tuesday, April 28, 2009

Building Native 64-bits Boost Library

I started using 64-bits Vista recently and I thought it made sense to make a native 64-bits build my favourite C++ library too.

My first attempt was a complete failure because I naively thought all I have to do is to run the bjam in Visual Studio 64-bits Tools Command Prompt. It turned out this only builds a regular 32-bits Boost library.

After some Googling and reading forum posts, I found some useful information in the Boost.Build document. Apparently, Boost does support building 64-bits target and what I end up doing is to specify the architecture and address-mode flags when running the bjam.

c:\boost_1_38_0>bjam ^
More? --toolset=msvc ^
More? --build-type=complete ^
More? architecture=x86 address-model=64 ^
More? stage

then I installed the library by

c:\boost_1_38_0>bjam ^
More? --toolset=msvc ^
More? --build-type=complete ^
More? architecture=x86 address-model=64 ^
More? install

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.