5

I installed boost v1.47 DLL (MT, Debug) for VC9 from boostpro. My code #include's <boost/regex.hpp>. When I try to build, VC gives me LNK1104 cannot open file libboost_regex-vc90-mt-gd-1_47.lib, even though boost_1_47/lib has been added to Additional Library Dependencies (in double quotes). The problem seems to be that the name of the library in the directory is not libboost_regex-vc90-mt-gd-1_47.lib, but simply boost_regex-vc90-mt-gd-1_47.lib.

How do I get VC to omit the leading 'lib' ? Any help would be greatly appreciated.

Thanks in advance

Kevin
  • 16,549
  • 8
  • 60
  • 74
Manish Jain
  • 91
  • 2
  • 5

1 Answers1

3

In Boost the lib prefix denotes whether the libraries were built for static or dynamic (shared) linking. To indicate you want to dynamically link the libraries (as the name without the lib prefix implies) define the preprocessor directive of BOOST_ALL_DYN_LINK.

In Visual Studio, go to the project's settings, and select Configuration Properties > C/C++ > Preprocessor page. Add BOOST_ALL_DYN_LINK to Preprocessor Definitions.

See also this related question: https://stackoverflow.com/a/2521866/483776

Community
  • 1
  • 1
Jacob Foshee
  • 2,704
  • 2
  • 29
  • 48