0

I'm trying to get some OGRE sample to compile in VS 2013 but I keep getting the same error no matter what I do:

error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)"

The OGRE SDK comes with the boost library. Unfortunatly it is not compatible with VS2013 so I've downloaded the last version compiled using VS2013. You can find it here

The "additional Include Directories" and "additional Library Directories" are properly setup.

Georges S.
  • 35
  • 2
  • 7

1 Answers1

0

The error state that you are using a symbol that is declared, but not implemented, boost::system::error_category is a method of boost, that various libraries use when managing errors, it belong to the system library, the implementation of this method is in [BOOST_ROOT]\boost\libs\system\src\error_code.cpp.

The most probably cause is that your are including the OGRE's library or part of the library that include some boost's libraries that use this method.

A lot of libraries from boost are header only, but this specific library system are not, it need compilation of this .cpp: two possible fixes are compiling an .LIB or .DLL from boost (see Prepare to Use a Boost Library Binary for more info about this) and using this in your project (could be better if you would be using a lot of libraries from boost that are not header only) or the most easy fix: including the error_code.cpp file in your project and compiling again.

NetVipeC
  • 4,402
  • 1
  • 17
  • 19
  • Thanks a lot, I've included **error_code.cpp** in my project and the error disappeared. Now I still don't understand why it didn't worked with the included **libboost_system-blablabla.lib**. – Georges S. Jul 21 '14 at 10:04
  • Most probably some problem compiling boost with VS2013, the common way of compiling boost is using their build manager (bjam previously, now is named b2, see the link posted), i think there some way using CMake too (that could generate VS projects from the CMake files, but is not totally supported yet) – NetVipeC Jul 21 '14 at 14:54
  • You were right all the way. I switched to using `libboost_system-vc110.lib` with VS2012 and it works. No need to include the `error_code.cpp` file in my project anymore. Thx – Georges S. Jul 24 '14 at 18:21