Software⏱️ 3 min read📅 2026-06-15

How to Fix: Visual Studio 2017 fatal error C1083: Cannot open source file: 'Main.cpp'

Visual Studio 2017 fatal error C1083: Cannot open source file: 'Main.cpp' due to case-sensitivity in the file system.

Quick Answer: Check if per directory case sensitivity is enabled and adjust accordingly.

Visual Studio 2017 is experiencing an error, C1083, which prevents users from building their projects. This issue primarily affects users who have changed the default directory for their projects and are using the Windows Subsystem for Linux.

This problem can be frustrating as it causes a build failure without providing any meaningful error message. In this guide, we will explore the root causes of this error and provide two methods to resolve it.

🛑 Root Causes of the Error

  • The primary reason for this error is case-sensitivity in the file system. The issue arises when per directory case sensitivity is enabled on Windows, which can cause Visual Studio to fail to locate source files that have been created with a different casing in the Windows Subsystem for Linux.
  • Another possible reason for this error is related to how the project location was set up. If the project location is not correctly configured or if there are issues with file permissions, it may lead to this error.

✅ Best Solutions to Fix It

Changing the file system settings

  1. Step 1: To fix this issue, go to File Explorer and right-click on the folder containing your project. Select Properties and then change the File type for the folder from 'Normal' to 'Standard (Windows XP style)'. This will disable case sensitivity.
  2. Step 2: Alternatively, you can also set the file system settings using the command prompt or PowerShell. Run the following command: `fsutil.exe file setcase C:\path\to\project 0` Replace `C:\path\to\project` with the actual path to your project folder.

Correcting project location configuration

  1. Step 1: If you are using the Windows Subsystem for Linux, make sure that the file system is properly set up. You can do this by running the following command: `sudo chown -R $USER:$USER /mnt/c/Dev` Replace `/mnt/c/Dev` with the actual path to your project folder. This will ensure that the files are owned by the correct user and group.
  2. Step 2: Another option is to create a symbolic link from the default location to the new location. You can do this using the command prompt or PowerShell: `mklink /j C: ew older C: olderto ew` Replace `C: ew older` with the actual path to your new project folder and `C: olderto ew` with the actual path to your default project folder.

✨ Wrapping Up

To summarize, the error C1083 in Visual Studio 2017 is caused by case sensitivity issues or incorrect project location configuration. By changing the file system settings or correcting the project location configuration, you can resolve this issue and build your projects successfully.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions