1

I try to use compiled Boost library (FileSystem) with Visual Studio. So, I add the boost lib directory in :

Project Properties > Linker > Additional Library Directories

The problem is Visual Studio try to add a prefix lib :

fatal error LNK1104: cannot open file 'libboost_filesystem-vc100-mt-gd-1_51.lib'

But the real name of the lib is simply boost_filesystem-vc100-mt-gd-1_51.lib

How to disable the prefix before the lib name ?

Thank you !

Thomas K
  • 1,067
  • 1
  • 15
  • 35
  • `libboost_filesystem-vc100-mt-gd-1_51.lib` is a static library. `boost_filesystem-vc100-mt-gd-1_51.lib` is an import library for a dll. You can find [here](http://www.boost.org/doc/libs/1_52_0/more/getting_started/windows.html#library-naming) the naming convention used by boost. You can either use shared linking in your project or rebuild boost using `link=static` if you must use static linking. –  Nov 14 '12 at 15:28
  • I saw this page but how to fix my problem ? – Thomas K Nov 14 '12 at 15:30
  • [This](http://stackoverflow.com/a/2521866/1252091) should work. –  Nov 14 '12 at 15:38
  • I didn't compile Boost, I used BoostPro. Any idea how to do with BoostPro ? Thx – Thomas K Nov 14 '12 at 15:49
  • As it was said in the link in my second comment, you just need to add `#define BOOST_ALL_DYN_LINK` before you include any boost header. You can put it for example in your stdafx.h. –  Nov 14 '12 at 16:04

1 Answers1

0

It wasn't a problem of a prefix. To fix that I just launched the BoostPro installer and installed all the debug lib.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Thomas K
  • 1,067
  • 1
  • 15
  • 35