Visual Studio: LINK : fatal error LNK1181: cannot open input file

Komn picture Komn · Jun 23, 2011 · Viewed 209.8k times · Source

I've been encountering a strange bug in Visual Studio 2010 for some time now.

I have a solution consisting of a project which compiles to a static library, and another project which is really simple but depends on this library.

Sometimes, in the last days extremely frequent, after Rebuilding the Solution or just compiling it with 1-3 changed source files, I get the following error:

2>LINK : fatal error LNK1181: cannot open input file 'thelibrary.lib'
========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ==========

Where compiling thelibrary.lib was a success without any errors or warnings.

I have tried cleaning the solution, but that doesn't always work.

  • What is wrong here?

Answer

Chris Thorne picture Chris Thorne · Jun 25, 2012

In Linker, general, additional library directories, add the directory to the .dll or .libs you have included in Linker, Input. It does not work if you put this in VC++ Directories, Library Directories.