Linker Tools Error LNK1104

cannot open file 'filename'

The tool could not open the given file.

To fix by checking the following possible causes:

  • Not enough disk space.

  • File does not exist.

  • When specifying libraries in a project's property pages dialog box, library names should be separated by spaces (and not commas).

  • Incorrect filename or path.

  • Invalid drive specification.

  • Insufficient file permissions.

  • Path for filename expands to more than 260 characters.

  • If the given file is named LNKn, which is a filename generated by the linker for a temporary file, the directory specified in the TMP environment variable may not exist, or more than one directory is specified for the TMP environment variable. (Only one directory path should be specified for the TMP environment variable.)

  • If the error message occurs for a library name, and you recently ported the .mak file from a previous Microsoft Visual C++ development system, the library may no longer be valid. Ensure that the library still exists in this circumstance.

  • Another program may have the file open and the linker cannot write to it.

  • Incorrect LIB environment variable. For information on how to update the LIB environment variable, see VC++ Directories, Projects and Solutions, Options Dialog Box . Make sure any directories with libraries you need are listed here.

The linker uses temporary files in several cases. Even if you have sufficient disk space, a very large link can deplete or fragment the address space.

To fix by using the following possible solutions

  • Use /OPT (Optimizations); doing transitive comdat elimination reads all the object files multiple times.

  • Upgrade to Windows XP.