Monday, April 29, 2013

How I build Boost for 64 bit Windows

I decided to build liblas binaries for 64 bit Windows since I could not easily find the 64-bit binaries. One of the prerequisites include boost. However, I had some difficulty getting 64-bit Boost binaries and header files, and the official Boost 64 bit installer seems to have x86 libraries included somehow causing me linking errors while building liblas. So I decided to compile Boost for x64 myself for liblas. The following steps are what I did to get Boost to compile.

  1. Download the latest Boost source code from Sourceforge http://sourceforge.net/projects/boost/files/boost/. Extract the files to a folder e.g. C:\Work\src\boost_1_52_0\.
     
  2. On the Windows desktop, select Start | All Programs | Microsoft Visual Studio 2010 | Visual Studio Tools | Visual Studio x64 Win64 Command Prompt.

    The Visual Studio x64 Win64 Command Prompt appears.
  3. In the Command Prompt, change directory to the extracted Boost source code folder e.g.

    C:\> cd \Work\src\boost_1_52_0
  4. In the Command Prompt, run the bootstrap.bat.

    C:\> bootstrap.bat

    Bootstrapping is done.
  5. In the Command Prompt, run b2.exe.

    C:\> b2 --toolset=msvc-10.0 architecture=x86 address-model=64 stage

    The Boost C++ libraries are built.

2 comments:

Unknown said...

hi ,

thank you for the helpful tutorial

quick question why are u setting the architecture as x86 not x64

thank you for your prompt reply

dominoc925 said...

hi there, that was a long time ago and my memory fades... It was probably to indicate Intel chips since there was no x64 option for that parameter.

Related Posts with Thumbnails