How to use Boost in Visual Studio 2010

后端 未结 13 1086
情歌与酒
情歌与酒 2020-11-22 07:14

What is a good step by step explanation on how to use the Boost library in an empty project in Visual Studio?

13条回答
  •  无人及你
    2020-11-22 07:28

    The Windows installers located here worked perfectly for me. I took the following steps:

    1. Follow the installation wizard until finished.
    2. Run visual studio.
    3. Create a new C++ project
    4. Open project properties (can be found by right-clicking the project name in the solution explorer)
    5. Under "C/C++ > General > Additional Include Directories" add the path where boost root directory. Default for my version was C:\local\boost_1_63_0. The number after "boost" is the version of boost.
    6. In project properties, under "Linker > Additional Library Directories" add the directory for library files. Default for my version was C:\local\boost_1_63_0\lib64-msvc-14.0. The number after "lib" is related to the build target (32 bit or 64 bit in Visual Studio) and the number after "msvc" is related to the version of Visual Studio (14.0 is related to Visual Studio 2015, but I'm using it with the 2017 Visual Studio).

    Good luck!

提交回复
热议问题