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

Solution 1:

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.

Solution 2:

I can see only 1 things happening here: You did't set properly dependences to thelibrary.lib in your project meaning that thelibrary.lib is built in the wrong order (Or in the same time if you have more then 1 CPU build configuration, which can also explain randomness of the error). ( You can change the project dependences in: Menu->Project->Project Dependencies )

Solution 3:

Go to:

Project properties -> Linker -> General -> Link Library Dependencies set No.

Solution 4:

I recently hit the same error. Some digging brought up this: http://support.microsoft.com/kb/815645

Basically, if you have spaces in the path of the .lib, that's bad. Don't know if that's what's happening for you, but seems reasonably possible.

The fix is either 1) put the lib reference in "quotes", or 2) add the lib's path to your Library Directories (Configuration Properties >> VC++ Directories).