C++ – linking to boost with visual studio 2013

boostclinkervisual studio

I'm trying to link to several boost libraries (the ones that need to be compiled) in visual studio 2013 and am having trouble doing so.

I've installed the boost files by runing from the command line

boostrap.bat

and

b2 --toolset=msvc-12.0 --build-type=complete architecture=x86 address-model=64 stage

so that the libraries are in C:\boost_1_56_0/stage/lib

In my project I go into configuration properties>c/c++>General>Additional include directories and include C:\boost_1_56_0 and include headers using for example
#include<boost/serialization/vector.hpp> among others

I then go to configuration properties>linker>additional library dependencies and include C:\boost_1_56_0\stage\lib

I am now aware that boost uses auto linking so I ensure that there are no attempts to directing link to the boost libraries in configuration properties>linker>input>additional dependencies

However I still get (many) linker errors of the following type:

error LNK2001: unresolved external symbol "public: void __thiscall boost::archive::detail::basic_oarchive::end_preamble(void)" (?end_preamble@basic_oarchive@detail@archive@boost@@QAEXXZ)

All the relevant questions I find concern misunderstandings of boost's auto linking facility, but I am now doing explicitly what I should be doing (to the best of my understanding). It is finding the the header files ok and the library files are where I am instructor the linker to look for them.

What might I be doing wrong?

Best Answer

There are tons of articles for linking boost in visual studio in stack overflow. One of them which I find minimal/complete is How to use Boost in Visual Studio 2010