Unable to use boost libraries in vs2013 for C++

2019-08-14 17:52发布

问题:

I have extracted boost_1_55_0 to my C disk (directly), then, I used console (as admin) to run bootstrap and then .\b2. After all that (and a long time), everything was done. Then, I opened my project, pushed the properties on my project and for C++ tab I included additional library (C:\boost_1_55_0), disable precompiled headers and in linkers general settings, I added addidtional library (C:\boost_1_55_0\stage\lib).

My program runs just fine if I am not including anything from boost, but just when I do (for ex, I tried including #include ), it stops compiling and says

C:\boost_1_55_0\boost/exception/exception.hpp(161): error C2955: 'std::set' : use of class template requires template argument list

and

C:\boost_1_55_0\boost/exception/exception.hpp(161): error C2838: 'set' : illegal qualified name in member declaration

Any ideas whats going on? I am not using any boost functions, I am just trying to include one boost library.

EDIT: I trimmed my main.cpp compeltely (only left one boost include and main class itself). Now it says that it is unable to access .lib file. I use windows 8.1 64bit. I think I am done with this OS, since it is so messed up when it comes to admin rights.

回答1:

Boost 1.55 does not support VS 2013 yet.

Quoting the release notes:

Visual Studio 2013 was released quite late in the release process, so there exist several unresolved issues.

So unless you are willing to patch Boost yourself, you will probably have to wait for the next Boost release.