Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is VisualStudio looking for this lib file? LNK1104 error

We have a large project using VS2008 and boost 1_42. I'm trying to upgrade to VS2010 and boost 1_44. I installed VS2010 and boost 1_44 and converted the project. Now I am trying to build, and everything compiles, but fails when linking:

LINK : fatal error LNK1104: cannot open file 'libboost_thread-vc90-mt-1_42.lib'

I have changed the include and lib directories to point to the new boost 1_44 files and I have renamed the old boost 1_42 directory.

Why is the linker still looking for a vc90-1_42 file, when it is only using 1_44 headers? Is there a way that I can determine WHY the linker wants this file? The linker obviously thinks it needs the file, but why?

I have cleaned the project and I am re-building to ensure any old build files are erased.

like image 544
JPhi1618 Avatar asked Nov 08 '10 16:11

JPhi1618


1 Answers

I've run into exactly this problem a couple of times too. It's usually been some old temporary files but like in your case cleaning didn't always do the trick straight away. Does your project include any static libs that might have been built with 1.42?

Something you can try which may or may not be helpful in tracking down your issue: Rename the old boost directory back to it's original name

  • Clean the solution
  • Under C/C++->Command Line->Additional Options add "/showIncludes"
  • Under Linker->Command Line->Additional Options add "/verbose:lib"
  • Rebuild all

Then when you build you'll be able to see at which point 1.42 headers are included, etc. in the output window. Somehow doing this helped me in tracking down where the problem was.

like image 94
Ralf Avatar answered Oct 19 '22 23:10

Ralf