This error occurs because the linker cannot find the
file name or the file path that is specified in the project properties. However, the
file path that is mentioned in the project properties is correct because the
linker does not handle the space character in the file path.
LNK1181 occurs when the .lib or .obj files that are specified during
linking, are not found in the current directory, any of the directories
that are specified by the LIBPATH linker option, or any of the
directories that are specified in the LIB environment variable.
The error may occur in the following
scenarios:
Scenario 1:
If the library that generates the error was added to the project
with a fully qualified path, the path may be invalid. The path is invalid if it
is not present on the system or if the path contains space characters.
Start Microsoft Visual Studio .NET or Microsoft Visual Studio 2005.
On the File menu, point to New, and then click Project.
In Visual C++ .NET 2002, click Visual C++ Projects under Project Types, and then click Managed C++ Application under Templates.
In Visual C++ .NET 2003, click Visual C++ Projects under Project Types, and then click Console Application (.NET) under Templates.
In Visual C++2005, click Visual C++ under Project Types, and then click CLR Console Application under Templates.
In the Name text box, type
TestLib.
In the Location text box, type
C:\Test, and then click OK.
In Solution Explorer, right-click the project, and then
click Properties.
In the Property Pages dialog box,
expand Linker, and then click
Input.
In the Additional Dependencies field,
type the library file. For example, you can type C:\Program
Files\mylib\mylib.lib.
You may receive the following error message when you
build the project:
fatal error LNK1181: cannot open input
file 'C:\Program.obj'
Scenario 2:
The linker error LNK1181 may also occur if you add an unqualified
file to the Additional Dependencies project property, and that
file does not exist in any of the search directories that are defined in the LIB environment variable or the /LIBPATH project
property. You may add the directory that contains library file to the
LIBPATH to resolve the problem:
In Solution Explorer, right-click the project, and then
click Properties.
In the Property Pages dialog box,
expand Linker, and then click
General.
In the Additional Library Directories
field, specify the required library path.
For additional information about possible causes for this
error message, see the following Microsoft Developer Network (MSDN) Web site for the similar LNK1104 linker error message: