Software⏱️ 2 min read📅 2026-05-31

How to Fix: Why does fatal error "LNK1104: cannot open file 'C:\Program.obj'" occur when I compile a C++ project in Visual Studio?

LNK1104 error occurs when the compiler tries to generate an object file that doesn't exist.

Quick Answer: Check if the 'Program.obj' file exists in the project directory, and ensure that the build configuration is set to generate object files.

The fatal error LNK1104: cannot open file 'C:\Program.obj' occurs when the compiler is unable to find the object file corresponding to a referenced library or executable. This issue can arise even if no code has been written yet, as it is often caused by incorrect project settings.

🛑 Root Causes of the Error

  • Incorrect file paths in the project settings.
  • A mismatch between the build and release configurations.
  • Missing or incorrect references to libraries or executables.

🛠️ Step-by-Step Verified Fixes

Method 1: Correcting File Paths

  1. Step 1: Open the Project Settings window by right-clicking on the project in the Solution Explorer and selecting 'Properties'.
  2. Step 2: In the Project Settings window, navigate to the 'Configuration Properties' section and ensure that the 'Object Files' path is set correctly.

Method 2: Verifying Build and Release Configurations

  1. Step 1: Open the Project Settings window and navigate to the 'Configuration Properties' section.
  2. Step 2: In the 'Configuration Properties' window, verify that the build configuration matches the release configuration. If not, change the build configuration to match the release configuration.

💡 Conclusion

By following these steps and verifying your project settings, you should be able to resolve the fatal error LNK1104: cannot open file 'C:\Program.obj' in Visual Studio 2008.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions