views:

109

answers:

3

Hi,

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?

+1  A: 

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.

Francesco
Where in the Linker section of Visual Studio 2008 would I find a list of directories?
Wawel100
A: 

Globally: Tools --> Options --> Projects and Solutions --> VC++ Directories "Library files" (as already answered above)

Per project: Project Properties --> Linker --> General --> Additional Library Directories

baton
A: 

Did you use any libraries before that required the Boost binary libraries for linkage? Many of the Boost libs are header-only - if you haven't previously used ones that aren't, then that's why you are hitting this now, and the solution is as posted by others - make sure they are present on your build box and set up the build env to reference them.

Steve Townsend