1

I would like to build my program on x86 Windows 7, which used the boost library. After reading the following post I tried to build boost and compile my program in debug mode. The output dialog in Visual Studio 2010 throws the following errors:

error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAABVerror_category@12@XZ) ...

I've used the following build commands to build boost: bjam --build-dir=c:\boost --build-type=complete --toolset=msvc-10.0 address-model=64 architecture=x86 -j 4 Note: command --with-system is not working for me.

My Project Settings are: Project->Properties->C/C++->General->Additional Include Directories: D:\boost\boost_1_57_0;%(AdditionalIncludeDirectories) and Project->Properties->Linker->General->Additional Library Directories: D:\boost\boost_1_57_0\stage\lib

How can I solve the unresolved external symbol errors?

Community
  • 1
  • 1
Sam
  • 387
  • 2
  • 9
  • 22
  • Have you checked the `D:\boost\boost_1_57_0\stage\lib` directory whether the library file exists? You should see something similar to `libboost_system-vc100-mt-gd-1_57.lib/dll` – Praetorian Apr 29 '15 at 18:33
  • yes, this file is available...do you have an other idea? – Sam Apr 30 '15 at 08:03
  • Could be something going wrong with auto linking. Try setting the linker to verbose mode (Show Progress option) and see what libraries it's attempting to link to. – Praetorian Apr 30 '15 at 13:43
  • @Praetorian I have cleaned my project and included each single library. The main problem is the asio library. I will try setting the linker to verbose mode and give you a response. – Sam May 01 '15 at 18:29

1 Answers1

2

I've solved the problem. I've recompiled the boost library 1.57 with the following command: b2 toolset=msvc-10.0 --build-type=complete --libdir=C:\boost\lib\x64 architecture=x86 address-model=64 install. Maybe, you should add the argument j%NUMBER_OF_PROCESSORS% to speed up the compile process.

Note: The main different to the command in my question is, that I use in this case b2 instead of bjam.

Sam
  • 387
  • 2
  • 9
  • 22