error LNK1104: cannot open file 'libboost_thread-vc100-mt-gd-1_55.lib'

Pritesh Acharya picture Pritesh Acharya · Mar 18, 2014 · Viewed 15.1k times · Source

I'm trying to link the shared library of boost thread into my application.

System: Windows8

IDE: Visual Studio 2010

I build the boost library using:

b2 --with-thread --build-type=complete link=shared

I can see the

boost_thread-vc100-mt-gd-1_55.dll
boost_thread-vc100-mt-gd-1_55.lib

and other file inside the stage/lib directory

I've added the path to Additional Library Directories and Input in linker option as:

Additional Library Directories: C:/boost_1_55_0_dyn/stage/lib

Input: C:\boost_1_55_0_dyn\stage\lib\boost_thread-vc100-mt-gd-1_55.lib

I don't know why on the earth Visual Studio is looking for libboost_thread-vc100-mt-gd-1_55.lib. I haven't mentioned the libboost_thread-vc100-mt-gd-1_55.lib anywhere in the properties or any place. I even search all my files and folders inside the project, libboost_thread-vc100-mt-gd-1_55.lib is not mentioned anywhere.

Answer

Pritesh Acharya picture Pritesh Acharya · Mar 19, 2014

Well I forgot to put BOOST_ALL_DYN_LINK in preprocessor definition. If the BOOST_ALL_DYN_LINK is not defined, boost looks for static library, that is why its looking for libboost_thread-vc100-mt-gd-1_55.lib