STXXL  1.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Compiling and Installing STXXL with Visual Studio 2010 and Boost
Timo Bingmann (2013)


Unpack STXXL source code

Download and Install Boost

  • We recommend the official binaries for MSVC. Visit and download the newest package for your compiler, e.g. boost_1_54_0-msvc-10.0-64.exe
  • When installing the package, make sure to install in directory
    instead of the default location. This is the most easy way to enable the CMake auto-detection macros to find Boost.
  • The pre-compiled Boost libraries are then located at
    C:\Boost\lib64-msvc-10.0 or similar.
    You must rename this directory to just lib for CMake to automatically find it.

In summary, CMake only looks for Boost at a few locations: C:\Boost for headers and C:\Boost\lib for library files. While it is possible to instruct CMake to look elsewhere for the necessary files, the easier way is to just rename the directories as required. Otherwise, the Boost location must be specified to CMake by setting the variables BOOST_ROOT, BOOST_INCLUDEDIR and BOOST_LIBRARYDIR in the dialog box each time.

Use CMake to Generate Visual Studio Projects

  • Open the CMake GUI.
  • Fill in the source code field with the place of the STXXL source and pick a build directory.
  • Pressing "Configure" brings up a dialog box: select your Visual Studio version (MSVC 10 here).
    Note that you must select between 32- and 64-bit building here.
  • Press "Generate" to run the CMake platform checks and to generate the Visual Studio project files.
  • If you get any error about CMake not being able to find Boost, refer to the previous section on the directories which CMake considers!
  • After generating the project, CMake presents a list of optional configuration switches. Maybe the most important are BUILD_TESTS and BUILD_EXAMPLES. By selecting them, additional subprojects are generated to build and run the unit tests for STXXL.

Use Visual Studio to Build STXXL

  • Afterwards, use Visual Studio to open the stxxl.sln STXXL "Solution" containing the projects.
  • Building the ALL_BUILD will first compile the STXXL library sources and then stxxl_tool and the test1 program in local/
  • You can immediately start working with STXXL by modifying the test1.cpp code in the local/ directory.
  • Simply switch Visual Studio into Release mode for building without assertions and extra checks.
  • To build the examples and test suite open up CMake, enable the check-boxes BUILD_EXAMPLES or BUILD_EXAMPLES and press "Generate" again. This will create many sub-projects in the Visual Studio solution.
For instruction on configuring disks on Windows, see Disk Configuration Files