1

I am trying to using the C++ Boost threading library in Visual Studio 2010 but get a linker error when including the thread library that requires the boost libs.

Here is the linker error after including <boost/thread/thread.hpp>

Error 2 error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (?generic_category@system@boost@@YAAEBVerror_category@12@XZ)

After some research I got the impression that this error can be caused by a bad installation or installation of the wrong build version so here is the installation steps I took.

  1. Downloaded boost_1_51_setup.exe from http://www.boostpro.com/download/

  2. Ran the installer selecting all the tick boxes on the threading and library page

  3. Allowed the installer to add an environment variable to the OS path

  4. In the visual studio project added C:\Program Files\boost\boost_1_51 to additional dependencies in C/C++-> General

  5. Finally added C:\Program Files\boost\boost_1_51\lib to additional libraries in Linker->General

I have triple checked all the path, all seem fine. And read the boost getting started page several time... I can't find what I'm missing.

I am running windows 8 x64, although I don't think this makes a difference.

Aᴍɪʀ
  • 7,623
  • 3
  • 38
  • 52
  • Possible duplicate of [Trying to link Boost 1.52 thread](http://stackoverflow.com/questions/14674374/trying-to-link-boost-1-52-thread) – Protoss May 29 '16 at 06:45

1 Answers1

0

Right click your project in the solution explorer and click properties.

Go to the VC++ directories tab and add the boost libraries do the 'Library Directories'.

You could also add the include folders to the 'Include Directories' section.

xcdemon05
  • 1,372
  • 5
  • 25
  • 49
  • Thanks for the reply but this didn't work, the problem isn't with the linker not finding the lib file as it can open it – user1143503 Feb 01 '13 at 19:49