C1xx fatal error c1083 не удается открыть файл источник

I was trying to #include a cpp file with some functions so I can use that cpp file later with other projects. It gave me an 'already defined in .obj' error and since then that .cpp file was like bi...

For people having problem related to «error C1083: Cannot open source file»:

Error is caused by settings in *.vcxproj file. Probably you deleted/moved source file by file explorer, not by Visual Studio’s «Solution Explorer». Thus, your *.vcxproj file is corrupted. Fix is to manually correct settings in *.vcxproj file.

How Visual Studio settings files work

Visual Studio saves solution’s info into file. This file is usually in project’s solution directory, has extension .sln and base name is same as name of solution, f.ex.:

NameOfSolution.sln

Similarly, project’s info is saved into one file (each project has its own file). Base name of this file is name of project, extension is .vcxproj, and usually is located in subdirectory named as your project, f.ex.:

NameOf1stProject/NameOf1stProject.vcxproj

NameOf2ndProject/NameOf2ndProject.vcxproj

Both *.sln and *.vcxproj files are textual files. You can open them by using Notepad.

How to fix problem

  1. Find *.vcxproj file responsible for your project.

    If you don’t know where it is, open in Notepad the *.sln file of your solution. Search for name of your solution. You will find line like:

    Project("{9AA9CEB8-8B4A-11D0-8D22-00B0C01AA943}") = "NameOf1stProject", "NameOf1stProjectNameOf1stProject.vcxproj", "{A8735D0A-25ED-4285-AB8F-AF578D8DB960}"
    

    Value under «NameOf1stProjectNameOf1stProject.vcxproj» is location of *.vcxproj file of your project.

  2. Open found *.vcxproj file by text editor (f.ex. Notepad).

  3. Search for line on which is filename you are struggling with.

    Example: if you are looking for «RemovedFile.cpp«, then you should find line:

    <ClCompile Include="RemovedFile.cpp" />
    
  4. Delete that line.

  5. If you have opened Visual Studio, it asks you if it should refresh solution — select yes. If it is not opened — just start using it.

  6. In case of any problems, try to rebuild solution (top banner -> Build -> Rebuild Solution)

In my cases, it worked. 30 mins of trying to fix, <1 minute of fixing.

description title ms.date f1_keywords helpviewer_keywords ms.assetid

Learn more about: Fatal Error C1083

Fatal Error C1083

09/01/2017

C1083

C1083

97e52df3-e79c-4f85-8f1e-bbd1057d55e7

Cannot open filetype file: ‘file‘: message

The compiler generates a C1083 error when it can’t find a file it requires. There are many possible causes for this error. An incorrect include search path or missing or misnamed header files are the most common causes, but other file types and issues can also cause C1083. Here are some of the common reasons why the compiler generates this error.

The specified file name is wrong

The name of a file may be mistyped. For example,

#include <algorithm.h>

might not find the file you intend. Most C++ Standard Library header files do not have a .h file name extension. The <algorithm> header would not be found by this #include directive. To fix this issue, verify that the correct file name is entered, as in this example:

#include <algorithm>

Certain C Runtime Library headers are located in a subdirectory of the standard include directory. For example, to include sys/types.h, you must include the sys subdirectory name in the #include directive:

#include <sys/types.h>

The file is not included in the include search path

The compiler cannot find the file by using the search rules that are indicated by an #include or #import directive. For example, when a header file name is enclosed by quotation marks,

#include "myincludefile.h"

this tells the compiler to look for the file in the same directory that contains the source file first, and then look in other locations specified by the build environment. If the quotation marks contain an absolute path, the compiler only looks for the file at that location. If the quotation marks contain a relative path, the compiler looks for the file in the directory relative to the source directory.

If the name is enclosed by angle brackets,

#include <stdio.h>

the compiler follows a search path that is defined by the build environment, the /I compiler option, the /X compiler option, and the INCLUDE environment variable. For more information, including specific details about the search order used to find a file, see #include Directive (C/C++) and #import Directive.

If your include files are in another directory relative to your source directory, and you use a relative path in your include directives, you must use double quotes instead of angle brackets. For example, if your header file myheader.h is in a subdirectory of your project sources named headers, then this example fails to find the file and causes C1083:

#include <headersmyheader.h>

but this example works:

#include "headersmyheader.h"

Relative paths can also be used with directories on the include search path. If you add a directory to the INCLUDE environment variable or to your Include Directories path in Visual Studio, do not also add part of the path to the include directives. For example, if your header is located at pathexampleheadersmyheader.h, and you add pathexampleheaders to your Include Directories path in Visual Studio, but your #include directive refers to the file as

#include <headersmyheader.h>

then the file is not found. Use the correct path relative to the directory specified in the include search path. In this example, you could change the include search path to pathexample, or remove the headers path segment from the #include directive.

Third-party library issues and vcpkg

If you see this error when you are trying to configure a third-party library as part of your build, consider using vcpkg, a C++ package manager, to install and build the library. vcpkg supports a large and growing list of third-party libraries, and sets all the configuration properties and dependencies required for successful builds as part of your project.

The file is in your project, but not the include search path

Even when header files are listed in Solution Explorer as part of a project, the files are only found by the compiler when they are referred to by an #include or #import directive in a source file, and are located in an include search path. Different kinds of builds might use different search paths. The /X compiler option can be used to exclude directories from the include search path. This enables different builds to use different include files that have the same name, but are kept in different directories. This is an alternative to conditional compilation by using preprocessor commands. For more information about the /X compiler option, see /X (Ignore Standard Include Paths).

To fix this issue, correct the path that the compiler uses to search for the included or imported file. A new project uses default include search paths. You may have to modify the include search path to add a directory for your project. If you are compiling on the command line, add the path to the INCLUDE environment variable or the /I compiler option to specify the path to the file.

To set the include directory path in Visual Studio, open the project’s Property Pages dialog box. Select VC++ Directories under Configuration Properties in the left pane, and then edit the Include Directories property. For more information about the per-user and per-project directories searched by the compiler in Visual Studio, see VC++ Directories Property Page. For more information about the /I compiler option, see /I (Additional Include Directories).

The command line INCLUDE or LIB environment is not set

When the compiler is invoked on the command line, environment variables are often used to specify search paths. If the search path described by the INCLUDE or LIB environment variable is not set correctly, a C1083 error can be generated. We strongly recommend using a developer command prompt shortcut to set the basic environment for command line builds. For more information, see Build C/C++ on the Command Line. For more information about how to use environment variables, see How to: Use Environment Variables in a Build.

The file may be locked or in use

If you are using another program to edit or access the file, it may have the file locked. Try closing the file in the other program. Sometimes the other program can be Visual Studio itself, if you are using parallel compilation options. If turning off the parallel build option makes the error go away, then this is the problem. Other parallel build systems can also have this issue. Be careful to set file and project dependencies so build order is correct. In some cases, consider creating an intermediate project to force build dependency order for a common file that may be built by multiple projects. Sometimes antivirus programs temporarily lock recently changed files for scanning. If possible, consider excluding your project build directories from the antivirus scanner.

The wrong version of a file name is included

A C1083 error can also indicate that the wrong version of a file is included. For example, a build could include the wrong version of a file that has an #include directive for a header file that is not intended for that build. For example, certain files may only apply to x86 builds, or to Debug builds. When the header file is not found, the compiler generates a C1083 error. The fix for this problem is to use the correct file, not to add the header file or directory to the build.

The precompiled headers are not yet precompiled

When a project is configured to use precompiled headers, the relevant .pch files have to be created so that files that use the header contents can be compiled. For example, the pch.cpp file (stdafx.cpp in Visual Studio 2017 and earlier) is automatically created in the project directory for new projects. Compile that file first to create the precompiled header files. In the typical build process design, this is done automatically. For more information, see Creating Precompiled Header Files.

Additional causes

  • You have installed an SDK or third-party library, but you have not opened a new developer command prompt window after the SDK or library is installed. If the SDK or library adds files to the INCLUDE path, you may need to open a new developer command prompt window to pick up these environment variable changes.

  • The file uses managed code, but the compiler option /clr is not specified. For more information, see /clr (Common Language Runtime Compilation).

  • The file is compiled by using a different /analyze compiler option setting than is used to precompile the headers. When the headers for a project are precompiled, all should use the same /analyze settings. For more information, see /analyze (Code Analysis).

  • The file or directory was created by the Windows Subsystem for Linux, per-directory case sensitivity is enabled, and the specified case of a path or file does not match the case of the path or file on disk.

  • The file, the directory, or the disk is read-only.

  • Visual Studio or the command line tools do not have sufficient permissions to read the file or the directory. This can happen, for example, when the project files have different ownership than the process running Visual Studio or the command line tools. Sometimes this issue can be fixed by running Visual Studio or the developer command prompt as Administrator.

  • There are not enough file handles. Close some applications and then recompile. This condition is unusual under typical circumstances. However, it can occur when large projects are built on a computer that has limited physical memory.

Example

The following example generates a C1083 error when the header file "test.h" does not exist in the source directory or on the include search path.

// C1083.cpp
// compile with: /c
#include "test.h"   // C1083 test.h does not exist
#include "stdio.h"  // OK

For information about how to build C/C++ projects in the IDE or on the command line, and information about setting environment variables, see Projects and build systems.

See also

  • MSBuild Properties

212 / 131 / 28

Регистрация: 20.03.2009

Сообщений: 1,123

Записей в блоге: 16

1

18.09.2016, 14:21. Показов 4724. Ответов 4


Собираю Qt 4.8 для Visual Studio 2015 по этой инструкции, на этапе configure появляются многочисленные c1xx : fatal error C1083: Cannot open source file из-за пробелов в пути к MS VS:

Код

Files
c1xx: fatal error C1083: Не удается открыть файл источник: Files: No such file or directory
Microsoft
c1xx: fatal error C1083: Не удается открыть файл источник: (x86)Microsoft: No such file or directory
Visual
c1xx: fatal error C1083: Не удается открыть файл источник: Visual: No such file or directory
Studio
c1xx: fatal error C1083: Не удается открыть файл источник: Studio: No such file or directory
include
c1xx: fatal error C1083: Не удается открыть файл источник: 14.0VCinclude: No such file or directory
Files
c1xx: fatal error C1083: Не удается открыть файл источник: Files: No such file or directory
Microsoft
c1xx: fatal error C1083: Не удается открыть файл источник: (x86)Microsoft: No such file or directory
Visual
c1xx: fatal error C1083: Не удается открыть файл источник: Visual: No such file or directory
Studio
c1xx: fatal error C1083: Не удается открыть файл источник: Studio: No such file or directory
QtCore
c1xx: fatal error C1083: Не удается открыть файл источник: 14.0VCincludeQtCore: No such file or directory
Files
c1xx: fatal error C1083: Не удается открыть файл источник: Files: No such file or directory
Microsoft
c1xx: fatal error C1083: Не удается открыть файл источник: (x86)Microsoft: No such file or directory
Visual
c1xx: fatal error C1083: Не удается открыть файл источник: Visual: No such file or directory
Studio
c1xx: fatal error C1083: Не удается открыть файл источник: Studio: No such file or directory
global
c1xx: fatal error C1083: Не удается открыть файл источник: 14.0VCsrccorelibglobal: No such file or directory
Files
c1xx: fatal error C1083: Не удается открыть файл источник: Files: No such file or directory
Microsoft
c1xx: fatal error C1083: Не удается открыть файл источник: (x86)Microsoft: No such file or directory
Visual
c1xx: fatal error C1083: Не удается открыть файл источник: Visual: No such file or directory
Studio
c1xx: fatal error C1083: Не удается открыть файл источник: Studio: No such file or directory
xml
c1xx: fatal error C1083: Не удается открыть файл источник: 14.0VCsrccorelibxml: No such file or directory

Судя по всему, проблема относится к студии (хотя пробелы в пути при работе с Qt — притча во языцех).

Команда configure выглядит так:

Код

D:Program Files (x86)Microsoft Visual Studio 14.0VC>D:SoftQt4.8msvc2015qt-everywhere-opensource-src-4.8.6configure -make nmake -platform win32-msvc2015 -prefix D:SoftQt4.8msvc2015 -opensource -confirm-license -opengl desktop -nomake examples -nomake tests



0



3433 / 2812 / 1249

Регистрация: 29.01.2016

Сообщений: 9,426

18.09.2016, 18:25

2

Командную строку студии запускаешь или cmd?



0



212 / 131 / 28

Регистрация: 20.03.2009

Сообщений: 1,123

Записей в блоге: 16

18.09.2016, 22:47

 [ТС]

3

Студийную (x86 Native Tools).



0



212 / 131 / 28

Регистрация: 20.03.2009

Сообщений: 1,123

Записей в блоге: 16

15.10.2016, 12:16

 [ТС]

4

Тем временем изначальную проблему удалось решить просто перейдя в командной строке прямо в диск D (избавившись от пробелов в корневом каталоге). Успешно создалась куча хидеров, но при создании qmake выскочила пачка ошибок типа

Код

cl : Command line warning D9024 : unrecognized source file type 'SOURCE_PATH', object file assumed
cl : Command line warning D9027 : source file 'SOURCE_PATH' ignored
cl : Command line warning D9024 : unrecognized source file type '=', object file assumed
cl : Command line warning D9027 : source file '=' ignored
cl : Command line warning D9024 : unrecognized source file type 'D:SoftQt4.8msvc2015qt-everywhere-opensource-src-4.8.6srccorelibxml', object file assumed
cl : Command line warning D9027 : source file 'D:SoftQt4.8msvc2015qt-everywhere-opensource-src-4.8.6srccorelibxml' ignored

А в конце выскочило опять:

Код

SOURCE_PATH
c1xx: fatal error C1083: Cannot open source file: SOURCE_PATH: No such file or directory
=
c1xx: fatal error C1083: Cannot open source file: =: No such file or directory
include
c1xx: fatal error C1083: Cannot open source file: D:SoftQt4.8msvc2015qt-everywhere-opensource-src-4.8.6include: No such file or directory
SOURCE_PATH
c1xx: fatal error C1083: Cannot open source file: SOURCE_PATH: No such file or directory
=
c1xx: fatal error C1083: Cannot open source file: =: No such file or directory
QtCore
c1xx: fatal error C1083: Cannot open source file: D:SoftQt4.8msvc2015qt-everywhere-opensource-src-4.8.6includeQtCore: No such file or directory
SOURCE_PATH
c1xx: fatal error C1083: Cannot open source file: SOURCE_PATH: No such file or directory
=
c1xx: fatal error C1083: Cannot open source file: =: No such file or directory
global
c1xx: fatal error C1083: Cannot open source file: D:SoftQt4.8msvc2015qt-everywhere-opensource-src-4.8.6srccorelibglobal: No such file or directory
SOURCE_PATH
c1xx: fatal error C1083: Cannot open source file: SOURCE_PATH: No such file or directory
=
c1xx: fatal error C1083: Cannot open source file: =: No such file or directory
xml
c1xx: fatal error C1083: Cannot open source file: D:SoftQt4.8msvc2015qt-everywhere-opensource-src-4.8.6srccorelibxml: No such file or directory

Это явно связано с этой строчкой в makefile.win32 для qmake:

Код

!if "$(SOURCE_PATH)" == ""
SOURCE_PATH = ..
!endif



0



212 / 131 / 28

Регистрация: 20.03.2009

Сообщений: 1,123

Записей в блоге: 16

16.10.2016, 17:56

 [ТС]

5

Проблему решил перейдя в командной строке в папку с configure, т.е. вместо

Код

D:Program Files (x86)Microsoft Visual Studio 14.0VC>D:SoftQt4.8msvc2015qt-everywhere-opensource-src-4.8.6configure [options]

или

Код

D:>SoftQt4.8msvc2015qt-everywhere-opensource-src-4.8.6configure [options]

должно быть

Код

D:SoftQt4.8msvc2015qt-everywhere-opensource-src-4.8.6>configure [options]



0



Evesie


    Автор темы

  • #1

1>------ Построение начато: проект: CSGO_Base, Конфигурация: Debug x64 ------
1>Файл проекта содержит ToolsVersion="15.0". Возможно, этот набор инструментов неизвестен или отсутствует (в этом случае проблему можно устранить, установив подходящую версию MSBuild), либо для данной сборки определено конкретное значение ToolsVersion в параметрах политики. Проект обрабатывается как имеющий ToolsVersion="4.0". Дополнительные сведения см. по ссылке http://go.microsoft.com/fwlink/?LinkId=291333.
1>  utils.cpp
1>c:usersivandesktopvk.combaterwarecsgo_basemain.h(4): fatal error C1083: Не удается открыть файл включение: inttypes.h: No such file or directory
1>  crc.cpp
1>  offset.cpp
1>c:usersivandesktopvk.combaterwarecsgo_basemain.h(4): fatal error C1083: Не удается открыть файл включение: inttypes.h: No such file or directory
1>  main.cpp
1>c:usersivandesktopvk.combaterwarecsgo_basemain.h(4): fatal error C1083: Не удается открыть файл включение: inttypes.h: No such file or directory
1>  _utils.cpp
1>c:usersivandesktopvk.combaterwarecsgo_baseleis../main.h(4): fatal error C1083: Не удается открыть файл включение: inttypes.h: No such file or directory
1>  _trigger.cpp
1>c:usersivandesktopvk.combaterwarecsgo_baseleis../main.h(4): fatal error C1083: Не удается открыть файл включение: inttypes.h: No such file or directory
1>  _skins.cpp
1>c:usersivandesktopvk.combaterwarecsgo_baseleis../main.h(4): fatal error C1083: Не удается открыть файл включение: inttypes.h: No such file or directory
1>  _radar.cpp
1>c:usersivandesktopvk.combaterwarecsgo_baseleis../main.h(4): fatal error C1083: Не удается открыть файл включение: inttypes.h: No such file or directory
1>  _player.cpp
1>c:usersivandesktopvk.combaterwarecsgo_baseleis../main.h(4): fatal error C1083: Не удается открыть файл включение: inttypes.h: No such file or directory
1>  _menu.cpp
1>c:usersivandesktopvk.combaterwarecsgo_baseleis../main.h(4): fatal error C1083: Не удается открыть файл включение: inttypes.h: No such file or directory
1>  _esp.cpp
1>c:usersivandesktopvk.combaterwarecsgo_baseleis../main.h(4): fatal error C1083: Не удается открыть файл включение: inttypes.h: No such file or directory
1>  _cvar.cpp
1>c:usersivandesktopvk.combaterwarecsgo_baseleis../main.h(4): fatal error C1083: Не удается открыть файл включение: inttypes.h: No such file or directory
1>  _client.cpp
1>c:usersivandesktopvk.combaterwarecsgo_baseleis../main.h(4): fatal error C1083: Не удается открыть файл включение: inttypes.h: No such file or directory
1>  _cheat.cpp
1>c:usersivandesktopvk.combaterwarecsgo_baseleis../main.h(4): fatal error C1083: Не удается открыть файл включение: inttypes.h: No such file or directory
1>  _aimbot.cpp
1>c:usersivandesktopvk.combaterwarecsgo_baseleis../main.h(4): fatal error C1083: Не удается открыть файл включение: inttypes.h: No such file or directory
1>  hook.cpp
1>c:usersivandesktopvk.combaterwarecsgo_basemain.h(4): fatal error C1083: Не удается открыть файл включение: inttypes.h: No such file or directory
1>  drawing.cpp
1>c:usersivandesktopvk.combaterwarecsgo_basemain.h(4): fatal error C1083: Не удается открыть файл включение: inttypes.h: No such file or directory
1>  client.cpp
1>c:usersivandesktopvk.combaterwarecsgo_basemain.h(4): fatal error C1083: Не удается открыть файл включение: inttypes.h: No such file or directory
1>  Создание кода...
========== Построение: успешно: 0, с ошибками: 1, без изменений: 0, пропущено: 0 ==========

Гугл не помог, ютуб тоже:(

wzhooh

Пользователь


Evesie


    Автор темы

  • #3

:CoolStoryBob:

pizdoglass


  • #4

Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.

найди книгу в интернете «с++ для чайников»

wzhooh

Пользователь


  • #5

:CoolStoryBob:

ну вот ищи где этот файл у тебя(если он вообще есть) и пропиши к нему путь.

Evesie


    Автор темы

  • #6

ну вот ищи где этот файл у тебя(если он вообще есть) и пропиши к нему путь.

Если ты мне скажешь где и как его прописать то я с удовольствием это сделаю)

найди книгу в интернете «с++ для чайников»

Ты мне очень помог своим остроумным комментарием

pizdoglass


  • #7

Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.

Если ты мне скажешь где и как его прописать то я с удовольствием это сделаю)

 
Ты мне очень помог своим остроумным комментарием

Попробуй вместо #include <inttypes.h> поставить это #include «inttypes.h»

wzhooh

Пользователь


  • #8

Если ты мне скажешь где и как его прописать то я с удовольствием это сделаю)

1.В папке с сурсом найди файл inttypes.h
2.Если есть,то проверь включен ли он в проект
3.Если нет его в проекте,то сделай включение.

  • Remove From My Forums
  • Question

  • Hi,

    I’m using Visual C++ 2005 Express, and I see that this type of error message has been giving a lot of people problems, but after trying a few of the fixes posted here, my project still gets the same error message.

    Here’s a snippet of my .h file:
    //randomcard.h

    int randomcard(void)

    {
       int randomnum;and here’s the top part of my .cpp file:

    #include <stdlib.h>

    #include <stdio.h>

    #include <ctype.h>

    #include <string.h>

    #include <time.h>

    #include «randomcard.h»

    #include <iostream>;


    Please let me know if you need anything else.  I turned off the header «stdafx.h» hoping that would fix it…but it still doesn’t work.

    Thanks in advance!


    nokomis

Answers

  • problem solved!  I just deleted the header file and created a new one…the error message went away.

    Thanks!

  • Hi nokomis,

    Congrats!

    At first glance, C1083 error seems to not be so significant.  I think it actually means a lot. In terms of program organization, it indicates that you do not provide other separately compiled program segments  with necessary interface info. In this context, I would say that you failed to define the problem that should be solved.
    Coding is very important, of course. At the same time, program design is also important.

    Hope this helps.

  • Remove From My Forums
  • Question

  • Hi,

    I’m using Visual C++ 2005 Express, and I see that this type of error message has been giving a lot of people problems, but after trying a few of the fixes posted here, my project still gets the same error message.

    Here’s a snippet of my .h file:
    //randomcard.h

    int randomcard(void)

    {
       int randomnum;and here’s the top part of my .cpp file:

    #include <stdlib.h>

    #include <stdio.h>

    #include <ctype.h>

    #include <string.h>

    #include <time.h>

    #include «randomcard.h»

    #include <iostream>;


    Please let me know if you need anything else.  I turned off the header «stdafx.h» hoping that would fix it…but it still doesn’t work.

    Thanks in advance!


    nokomis

Answers

  • problem solved!  I just deleted the header file and created a new one…the error message went away.

    Thanks!

  • Hi nokomis,

    Congrats!

    At first glance, C1083 error seems to not be so significant.  I think it actually means a lot. In terms of program organization, it indicates that you do not provide other separately compiled program segments  with necessary interface info. In this context, I would say that you failed to define the problem that should be solved.
    Coding is very important, of course. At the same time, program design is also important.

    Hope this helps.

I am a brand new user of Visual Studio 2017 and I am having difficulty building a simple HelloWorld project. Here’s what I am doing:

File > New > Project…

I choose Empty Project. I rename the project HelloWorld and I change the location from the default location on my c drive to a location inside my Dev folder, which is on my d drive. Once the project is created, I right click Source Files and add a file called Main.cpp, containing the simplest code:

int main() {
   return 0;
}

However, when I right-click HelloWorld and Build, I receive the following output:

1>------ Build started: Project: HelloWorld, Configuration: Debug Win32 ------
1>Main.cpp
1>c1xx : fatal error C1083: Cannot open source file: 'Main.cpp': No such file or directory
1>Done building project "HelloWorld.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

However, I only receive this error if I change the Location of the project. If I use the default directory, c:my_userSourcerepos then the project builds without any issue. But I would like to know how to fix this error, because I don’t want to keep my files on my c drive. Has anyone else experienced this problem who might know how to fix it? Because I am at a loss.

EDIT According to a Microsoft docs article on Fatal Error C1083:

An additional cause of this error is case-sensitivity in the file
system, either for the file name or path, if per directory case
sensitivity is enabled, and the directories were created by the
Windows Subsystem for Linux.

This is the case for me. When I bought this laptop, I downloaded all my files, including my Dev folder, from my PC using rsync in Window Subsystem for Linux. So this directory wasn’t created by Windows, but by Ubuntu running on WSL. This may be the cause of the problem, but I still don’t know how to fix it. Even if it is case sensitive, I am typing the folder with the correct case, so I don’t know why it wouldn’t work.

SOLVED In case anyone else encounters this problem, it was an issue with WSL. I never would have guessed this. If you want to use a folder that was created with WSL for your Visual Studio project, you have to disable case-sensitivity:

  1. Run Windows Powershell as admin
  2. Run the command:

fsutil.exe file setCaseSensitiveInfo d:my_wsl_created_folder disable

This fixed the issue for me!

Для людей, имеющих проблемы, связанные с «ошибка C1083: не удается открыть исходный файл»:

Ошибка вызвана настройками в файле *.vcxproj. Возможно, вы удалили/переместили исходный файл с помощью проводника, а не Visual Studio «Solution Explorer». Таким образом, ваш *.vcxproj файл поврежден. Исправить это вручную исправить настройки в файле *.vcxproj.

Как работают файлы настроек Visual Studio

Visual Studio сохраняет информацию о решении в файл. Этот файл обычно находится в каталоге решения проекта, имеет расширение .sln, а базовое имя совпадает с именем решения, например:

NameOfSolution.sln

Аналогично, информация о проекте сохраняется в одном файле (каждый проект имеет свой собственный файл). Базовое имя этого файла — имя проекта, расширение -.vcxproj, и обычно оно находится в подкаталоге с именем вашего проекта, например:

NameOf1stProject/NameOf1stProject.vcxproj

NameOf2ndProject/NameOf2ndProject.vcxproj

Файлы *.sln и *.vcxproj являются текстовыми файлами. Вы можете открыть их с помощью Блокнота.

Как решить проблему

  1. Найдите файл *.vcxproj, отвечающий за ваш проект.

    Если вы не знаете, где это, откройте в Блокноте файл *.sln вашего решения. Поиск по названию вашего решения. Вы найдете строку как:

    Project("{9AA9CEB8-8B4A-11D0-8D22-00B0C01AA943}") = "NameOf1stProject", "NameOf1stProjectNameOf1stProject.vcxproj", "{A8735D0A-25ED-4285-AB8F-AF578D8DB960}"
    

    Значение в «NameOf1stProjectNameOf1stProject.vcxproj» — это расположение файла *.vcxproj вашего проекта.

  2. Откройте найденный файл *.vcxproj с помощью текстового редактора (например, Блокнот).

  3. Найдите строку с именем файла, с которым вы боретесь.

    Пример: если вы ищете «RemovedFile.cpp», то вы должны найти строку:

    <ClCompile Include="RemovedFile.cpp" />
    
  4. Удалить эту строку.

  5. Если вы открыли Visual Studio, вам будет предложено обновить решение — выберите «Да». Если он не открыт — просто начните его использовать.

  6. В случае каких-либо проблем попробуйте перестроить решение (верхний баннер → Построить → Перестроить решение)

В моих случаях это сработало. 30 минут попыток исправить, <1 минута исправления.

Понравилась статья? Поделить с друзьями:
  • C1d22 ошибка форд
  • C1d21 ошибка форд мондео 4
  • C1d00 ошибка форд транзит
  • C1d00 23 ошибка форд фокус 3
  • C1c20 64 ошибка рено дастер