Boost logo

Boost :

Subject: [boost] Boost Threads - x86 Platforms / 64 bits compilation in Managed/Unmanaged Code / Visual Studio 2010 / Windows SDK 7.1 /clr
From: Guillaume Rembert (grembert_at_[hidden])
Date: 2012-05-07 07:28:05

As I had lots of issues to include boost thread libraries in a windows
64 bits code generated under Visual Studio 2010, here are the different
steps to follow in order to get it compiling and executing quickly (mix
of lots of the different specific posts). I could not find an easy, up
to date procedure for this.

This has been tested with Boost 1_49_0 release, Visual Studio 2010,
Windows SDK 7.1 and Microsoft .NET 4.

- Download 64 bits libraries, as binaries: +
unzip in a dedicated folder (for the example C:\boost\lib64)
- Download boost headers and source code: + unzip in a
dedicate folder (for the example C:\boost)
- Set the project not to use precompiled headers + compilation with /clr
to mix managed and unmanaged code
- Add the headers path to the project additional include directories (in
the example C:\boost)
- Add the compiled libraries path to the linker additional library
directories (in the example C:\boost\lib64)
- Add to your project the following lines (force dynamic linking):
#include <boost/thread.hpp>

--> Just compile and execute, it should not give any problems.

The first line (#define BOOST_ALL_DYN_LINK) solves the following error I

An unhandled exception of type 'System.TypeInitializationException'
occurred in Unknown Module.

Additional information: The type initializer for '<Module>' threw an

Boost list run by bdawes at, gregod at, cpdaniel at, john at