Building Boost for applications analyzed by Intel Inspector XE

To analyze applications using Boost* on Microsoft Windows*, you must compile your application and Boost libraries (for example, boost_thread-vc80-mt-gd-1_42.dll etc.) with debugging information enabled (/Zi) and optimization disabled (/Od) and the C runtime dynamically linked in. To make sure you have debugging information enabled and optimization disabled, you can download the Boost source and build the libraries yourself. The .pdb files need to be placed next to the binaries or at the location of pdb paths coded in the binaries.

To build boost from source, the following command can be used:



bjam.exe toolset=msvc-8.0 variant=debug link=shared threading=multi runtime-link=shared --stagedir=./ --build-type=complete --with-date_time --with-thread

The toolset can also be set to msvc-7.0, mscv-9.0 or mscv-10.0.

Once built, all of the libs and dlls are put in boost/lib. However, the pdb files are left in the build directories ( bin.v2/libs/..). The pdb files should be manually copied to the boost/lib directory.

Also, when compiling code that uses Boost, the default is to use static libraries. To use dynamic link libraries, BOOST_ALL_DYN_LINK must be defined when the code is compiled, for example:

cl.exe /Zi /Od /GS- /MDd /EHsc /DBOOST_ALL_DYN_LINK boost_mutex1.cpp

Einzelheiten zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.