0

I'm having a problem building a windows C++ project with a specially modified version of the boost library. I'm not using bjam, but instead have a custom project using cmake to manage building a small sub-set of the boost libraries. Everything seems to compile fine, but then I get a linking error for an entity that was never mentioned in cmake or any of the source files:

2>LINK : fatal error LNK1104: cannot open file 'libboost_thread-vc100-mt-gd-1_54.lib'

I searched for this string in my build folder using 'findstr', and found it mentioned in thread.obj in this context:

/DEFAULTLIB:liboobst_thread-vc100-mt-gd-1_54.lib

My question is: where did this /DEFAULTLIB tag come from and how do I prevent it? I turned on explicit compile and linking flags ("Suppress Startup Banner"=No) and it is not mentioned anywhere during the build process.

Edit: Per commenters, this is part of the auto-linking feature in boost, which can be disabled with the BOOST_ALL_NO_LIB definition. Described here.

Community
  • 1
  • 1
KyleL
  • 1,379
  • 2
  • 13
  • 35
  • 1
    My guess is, it's from a `#pragma comment(lib, ...)` in the code somewhere. – Borgleader Dec 23 '14 at 19:39
  • 2
    It comes from a boost .hpp file, it contains #pragma comment(lib, "..."). You'll need to tell the linker where to look for the .lib file, it can't find it by itself because it doesn't know where you put boost. – Hans Passant Dec 23 '14 at 19:39
  • 1
    Is there a proper way to tell Boost to not specify those pragma lib statements? – KyleL Dec 23 '14 at 19:49
  • 2
    Related http://stackoverflow.com/questions/27254718/maps-in-shared-memory-boost-interprocess-demo-fails-due-to-unmet-date-time-depe/27254899#27254899 – sehe Dec 23 '14 at 20:06

1 Answers1

0

Per the commenters, this is part of the auto-linking feature in boost, which can be disabled with the BOOST_ALL_NO_LIB definition. Described here.

Community
  • 1
  • 1
KyleL
  • 1,379
  • 2
  • 13
  • 35