I’m attempting to use the boost library in my C++ project (Visual Studio 2008).
However on including the boost functions for time:
#include <boost/date_time/gregorian/gregorian.hpp>
I get the following error (along with a number of warnings):
fatal error LNK1104: cannot open file 'libboost_date_time-vc90-mt-gd-1_44.lib'
The file ‘libboost_date_time-vc90-mt-gd-1_44.lib’ is present on my machine and I’ve used
the boost library before without any difficulties.
Any idea what might be wrong?
The linker cannot find the library file. This could mean that it is not searching in the correct directories. In the properties of the project you should go to the Linker section and make sure that the boost dir is correctly spelled out. Right click on the project, click on Properties -> Configuration properties -> Linker -> Input and you will find “Additional dependencies”.
System wide you can go to Tools -> Options -> Projects and solutions -> VC++ Directories, then pick “Library files” in the pull down menu on the right.
If I recall correctly the boost pro installer takes care of this.