c++visual-studioboostlinker-errorslnk2001

#include <boost/chrono.hpp> causes unresolved external symbol, bcp used


I'm not an experienced programmer. I tried to cut part of boost and paste it directly into my project which is a C++ solution in Visual Studio 2010. I've done it this way:


Do I use bcp correctly?
What should I do to make it work?


Solution

  • The process for installing Boost for use with Visual Studio is spelled out fairly clearly here. You shouldn't need to write any installation scripts.

    It's important to know that most Boost libraries are header-only (such as Boost.Lexical_Cast), yet some require you to link to a static library (such as Boost.System). See this section of the Getting Started document on how to let Visual Studio know where the Boost static libraries are.

    This section lists which libraries are not header-only. Some libraries (such as Boost.Chrono and Boost.Asio) are themselves header-only, but they depend on Boost.System which needs to be linked into your program.

    Hope this helps.