Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?
like image 231
Komn Avatar asked Jun 23 '11 08:06

Komn


People also ask

How do I fix LNK1181?

The solution to this situation is to enclose the long file name (path plus file name) in quotation marks. Compiling with the /P (Preprocess to a File) option can result in LNK1181 because that option suppresses the creation of . obj files.

How do I fix error lnk1104?

To fix this issue, stop the program and unload it from the debugger before building it again. If the app is open in another program, such as a resource editor, close it. If your program is unresponsive, you may need to use Task Manager to end the process. You might also need to close and restart Visual Studio.

Where is kernel32 Lib located?

kernel32. lib is THE fundamental Windows API library. It is found in the Windows SDK and the default set of library locations should include it.


1 Answers

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.

like image 130
Chris Thorne Avatar answered Sep 28 '22 05:09

Chris Thorne