简体   繁体   中英

Error LNK1181: cannot open input file when compiling as .LIB

I got a library here which uses the Intel Composer XE 2013 and I would like to compile it as a .lib as I am going to use it with another project (It is compiling as application/EXE by default). However, when I set the Configuration Type under Project Defaults under the Configuration Manager in Visual Studio 2012, I get " error LNK1181: cannot open input file" Odd part is that the file it looks for has no file ending. The project contains both C, C++ and ASM code. Does anyone got any experience with this kind of behavior?

Some common causes for error LNK1181 are:

  • filename is referenced as an additional dependency on the linker line, but the file does not exist.
  • A /LIBPATH statement that specifies the directory containing filename is missing.

To resolve the above issues, ensure any files referenced on the linker line are present on the system.

Use the /LIBPATH option to override the environment library path. The linker will first search in the path specified by this option, and then search in the path specified in the LIB environment variable. You can specify only one directory for each /LIBPATH option you enter. If you want to specify more than one directory, you must specify multiple /LIBPATH options. The linker will then search the specified directories in order.

To set this linker option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box.
  2. Click the Linker folder.
  3. Click the General property page.
  4. Modify the Additional Library Directories property.

If that doesn't help then you can look through these links :

I solved the issue by renaming the .obj files without their file extension. For example, it was looking for file name "foo", I had "foo.obj" so I renamed "foo.obj" to "foo".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM