How to use Boost in Visual Studio 2010

后端 未结 13 1101
情歌与酒
情歌与酒 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:29

    A small addition to KTC's very informative main answer:

    If you are using the free Visual Studio c++ 2010 Express, and managed to get that one to compile 64-bits binaries, and now want to use that to use a 64-bits version of the Boost libaries, you may end up with 32-bits libraries (your mileage may vary of course, but on my machine this is the sad case).

    I could fix this using the following: inbetween the steps described above as

    1. Start a 32-bit MSVC command prompt and change to the directory where Boost was unzipped.
    2. Run: bootstrap

    I inserted a call to 'setenv' to set the environment. For a release build, the above steps become:

    1. Start a 32-bit MSVC command prompt and change to the directory where Boost was unzipped.
    2. Run: "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\setenv.cmd" /Release /x64
    3. Run: bootstrap

    I found this info here: http://boost.2283326.n4.nabble.com/64-bit-with-VS-Express-again-td3044258.html

提交回复
热议问题