1

I read through the boost documentation using the '5.3.4 Invoke b2' and followed up with forum threads that explained details of linking the boost library to the header and linker directories, in the boost help '4.1 Build From the Visual Studio IDE', and found this cool boost related wiki that explained the bjam.exe controls.

placed #include <boost/thread/thread.hpp> in the main.cpp

And, I get this linker error, and the existing help threads have identified the problem is with x64:

The error:

error LNK2019: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (?generic_category@system@boost@@YAAEBVerror_category@12@XZ) referenced in function "void __cdecl boost::system::`dynamic initializer for 'posix_category''(void)" (??__Eposix_category@system@boost@@YAXXZ)  main.obj

error LNK2019: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAAEBVerror_category@12@XZ) referenced in function "void __cdecl boost::system::`dynamic initializer for 'native_ecat''(void)" (??__Enative_ecat@system@boost@@YAXXZ)  main.obj

they are similar, something about 'posix_category' and something about 'native_ecat'

So, I tried to build the x64 boost library, and found conflicting instructions on where to put these:

Also, I tried changing the vs2008 configuration back to x32 -> solutionExplorer/solution_properties/configuration_manager/active_solution_platform - Win32, closed and reopened visual studio - relinked the additional directories C/C++/general and Linker/general to Boost/root and Boost/stage/lib - and it compiled without error.

My best guess at the b2 commands is --toolset=msvc-9.0 address-model=64 --build-type=complete --stagedir=lib\x64 stage

Please give concise instructions for how to build and install x64 version of boost on VS2008. Also, what was the wiki talking about for release and debug - they are not in Boost invocation?

Community
  • 1
  • 1
forest.peterson
  • 755
  • 2
  • 13
  • 30
  • Any reason you are using 5.3 from the installation instructions instead of "5.2 Simplified Build From Source" ? – us2012 Mar 06 '13 at 20:37
  • @us2012 nothing specific - i saw that but was not sure what it is, it is preceded with "5.1 Install Visual Studio Binaries" and talks about "BoostPro Computing" who are no longer producing installs, so i probably skipped over it and went for what looked like most help threads I'd read about bjam.exe - fair enough... – forest.peterson Mar 06 '13 at 20:55
  • I'm not saying that it will solve your problem, but since it's fully automated and super-easy to use, I suggest you at least try it. – us2012 Mar 06 '13 at 20:56
  • yes, but it is the super automated and super easy part that has me worried. I have VS 2005, 2010, and a beta 2011 installed that in earlier installs caused the automated and easy approach to become complicated and convoluted :) – forest.peterson Mar 06 '13 at 21:11
  • I encountered this issue while using the boost auto-linking, and fixed it by adding #include <../boost_libs.h> – Pieter Mar 16 '17 at 13:00

1 Answers1

-3

use c++ 11

It more or less includes all the features of boost I wanted to use, also compiles in g++ without figuring out how to build the boost library on my university server and then reference into a remote g++ build - pretty much solved everything with that

forest.peterson
  • 755
  • 2
  • 13
  • 30
  • The C++11 standard library is not a complete replacement for Boost. Besides, most of the Boost libraries are header-only and don't need you to compile anything up-front at all, those who aren't seldom depend on other libraries so you can just copy their sources and compile them with a proper build tool, see for example https://github.com/filmor/webos-pdf. – filmor Mar 22 '13 at 11:43
  • I am was using boost::thread and after two days could not figure out how to get the library in the g++ build - and even if I did there is a bug in the 6.4 version of RedHat - c++ 11 worked. My advice to anyone else in the same situation is to use c++ 11. Also, your link does not go to anything. – forest.peterson Mar 22 '13 at 16:31
  • Could you elaborate on the bug in Red Hat? Besides, this question is evidently about Windows so it's a completely different situation. The link I've given goes to a project of mine where I integrated the Boost.Thread library, where it suffices to add 4 source files (see https://github.com/filmor/webos-pdf/tree/master/boost_thread). – filmor Apr 02 '13 at 10:45
  • you are correct - I asked this question about win but it was part of a larger effort for a version in linux, which apparently would have failed even if I resolved the question with the x64 library. I should not have mentioned it in this thread - I also posted a question on our University email discussion and was warned that "In case this is on Red Hat Enterprise Linux 6.4, there is a new bug introduced in 6.4 with boost thread libraries and the gcc/g++ version in stock 6.4: Red Hat Bugzilla Bug 908774" I am happy with the c++ 11 thread solution but now understand how your solution would work – forest.peterson Apr 02 '13 at 18:30