Не удается открыть источник файл crtdbg h dependency of iostream
using namespace std;
int main()
string firstName, lastName;
double hourRate, numHours;
My c_cpp_properties.json file
Let me know if you need any more information
The text was updated successfully, but these errors were encountered:
Дополнительные причины
Вы установили пакет SDK или библиотеку стороннего производителя, но после установки пакета SDK или библиотеки не открывали новое окно командной строки разработчика. Если пакет SDK или библиотека добавляет файлы в путь поиска включаемых файлов, может потребоваться открыть новое окно командной строки разработчика, чтобы получить эти изменения переменных среды.
Файл использует управляемый код, но параметр /clr компилятора не указан. Дополнительные сведения см. в разделе /clr (компиляция среды CLR).
Файл компилируется с использованием другого /analyze параметра компилятора, чем используется для предварительной компиляции заголовков. При предварительной компиляции заголовков для проекта все должны использовать одни и те же /analyze Параметры. дополнительные сведения см. в разделе /analyze (Code Analysis).
файл или каталог был создан подсистема Windows для Linux, учитывается регистр в каждом каталоге, и указанный регистр пути или файла не соответствует регистру пути или файла на диске.
Файл, каталог или диск доступен только для чтения.
Visual Studio или средства командной строки не имеют достаточных разрешений для чтения файла или каталога. это может произойти, например, когда файлы проекта имеют разные права владения, чем процесс, выполняемый Visual Studio или программ командной строки. иногда эту ошибку можно устранить, запустив Visual Studio или командную строку разработчика от имени администратора.
Недостаточно дескрипторов файлов. Закройте часть приложений и повторите компиляцию. Эта ситуация маловероятна в обычных условиях. Однако она может возникать при построении крупных проектов на компьютере с ограниченной физической памятью.
NikoGP commented Sep 20, 2017
bobbrow commented Sep 27, 2017
@smithalexk, for me, this file resides in /usr/include . What does clang -Wp,-v -E -xc -x c++ /dev/null show as your include path? The "includePath" in your c_cpp_properties.json file should match that.
sean-mcmanus commented Sep 20, 2017
@NikoGP Go to File->Preferences->Settings and search for "intelliSenseEngine" to find the setting. You have "Default" set already though. Did you run the gcc command @bobbrow mentioned? Can you provide your updated c_cpp_properties.json? You basically need to find where your iostream header is getting pulled from by your compiler and add the path to the includePath setting (and make sure the defines are correct). Does Go to Definition work on the header file? If so, that means the iostream file was found via a recursive search of your browse.path setting.
Developer Tools Log
Language server log
GiBg1aN commented Sep 19, 2017
If you are using Linux you have to add the path /usr/include/linux
ZoeVonFeng commented Sep 20, 2017 •
I had same issue on windows, after I add the "C:\\cygwin64\\lib\\gcc\\x86_64-pc-cygwin\\6.4.0\\include\\c++" at includePath, I got this error: cannot open source file "bits/c++config.h" (dependency of "iostream")
bobbrow commented May 13, 2021
The first thing I can think of here is that some paths of your SDK are missing, so cpptools rejects it and selects the 8.1 SDK instead. Can you check if the "um", "ucrt" and "shared" folders all exist in your "10.0.10240.0" folder? If any of those are missing, the SDK will be considered incomplete and cpptools will not use it. You might need to reinstall your SDK in that case, or update to a newer one.
If that's not it, then perhaps the registry key pointing to the SDK is missing (which can also be fixed by reinstalling the SDK). This is the key cpptools checks for the Windows 10 SDK: HKLM\SOFTWARE\Microsoft\Windows Kits\Installed Roots\KitsRoot10
A note about the workaround you are currently using:
Is it not advised to add the CRT include paths directly to c_cpp_properties.json . For the path you want, you should be able to set the property "windowsSdkVersion": "10.0.10240.0" in your configuration and cpptools should use that path. If you remove the CRT path and set the windowsSdkVersion but it still does not work, please let us know (assuming the folders mentioned above are present).
Question
I HAVE BEEN LOOKING ON THE WHOLE INTERNET, YOUTUBE, GOOGLE AND NOTHING WORKS. PLEASE HELP.
CODE:
using namespace std;
bobbrow commented Sep 20, 2017 •
What version of MinGW are you using? In your first post, it looked like you had 6.3.0 in your include path. In your most recent post, it looked like you pasted in include paths for 5.3.0 from our MinGW page.
dorsa1986 commented Oct 2, 2017
NikoGP commented Sep 20, 2017
Указано неверное имя файла
При вводе имени файла допущена ошибка. Например, примененная к объекту директива
может не найти файл, который вы хотели. Большинство файлов заголовков стандартной библиотеки C++ не имеют расширения h. . Чтобы устранить эту проблему, убедитесь, что указано правильное имя файла, как в следующем примере:
Platform and Versions
- Operating System: Windows
- CMake Version: 3.15, or 3.19
- VSCode Version:
- CMake Tools Extension Version: 1.56.1 system setup
- Compiler/Toolchain: Visual Studio 2019 BuildTools
smithalexk commented Sep 27, 2017
Yep that looks to have fixed it. Thanks for the help!
For reference, I was missing:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks
Файл находится в проекте, но не в пути поиска включаемых файлов
Чтобы устранить эту проблему, исправьте путь, используемый компилятором для поиска включаемого или импортируемого файла. В новом проекте используются пути поиска include по умолчанию. Может потребоваться изменить путь поиска include, чтобы добавить каталог для проекта. При компиляции в командной строке добавьте путь к переменной среды include или /I параметр компилятора, чтобы указать путь к файлу.
чтобы задать путь к каталогу включения в Visual Studio, откройте диалоговое окно страницы свойств проекта. выберите VC++ каталоги в разделе свойства конфигурации в левой области, а затем измените свойство включаемые каталоги . дополнительные сведения о каталогах для отдельных пользователей и проектов, поиск которых выполняется компилятором в Visual Studio, см. в разделе страница свойств VC++ directories. Дополнительные сведения о параметре компилятора см. в /I разделе /I (дополнительные каталоги включаемых данных).
zeroxia commented May 17, 2021
Thank you for your feedback.
For the Windows platform, as @bobbrow pointed out, probably it's due to the incomplete Windows SDK, as I only do platform independent coding, so When installed the Visual Studio, I chose bare minimum components, and I believe the bundled Windows SDK 10.0.101240.0 was not included. So I restart the installer and selected that Windows 10 SDK, the squiggle in the VS Code is dismissed now. Thank you very much for helping me to fix this annoying issue.
But on Mac OS, the same testing project, with Visual Studio Code version 1.56.2, ms-vscode.cpptools version 1.3.1, cmake-tools version 1.7.3, there is also squiggle under , saying endian.h is not found. Screenshot as follows:
Error message in the problems panel:
cannot open source file "endian.h" (dependency of "iostream")
Again, the building and running of this simple demo has no problem, right click on the header and select "Go to definition" can open the header file.
Is there something I'm missing installing? MacOS version is: 11.2.1 (Big Sur), Xcode version is 12.5.
Unlike Visual Studio, Xcode is installed from AppStore, and there is no customization at all.
I've checked this page:
First tried this: xcode-select --install , after successful installation, not working. There is no /usr/include .
And searching through /Library/ , and there is no *.pkg file found.
Before installing these command line tools, I can find the endian.h file at:
After installing the command line tools, I found that the file is also at:
Компилятор создает ошибку C1083, когда не удается найти требуемый файл. Эта ошибка имеет несколько возможных причин. Наиболее распространенными причинами являются неверный путь поиска include или отсутствующие или неправильно именованные файлы заголовков, но другие типы файлов и проблемы могут также вызвать C1083. Ниже приведены некоторые распространенные причины, по которым компилятор создает эту ошибку.
smithalexk commented Oct 2, 2017
Hi @dorsa1986, I also noticed that you spelled "iostream" incorrectly. You are currently including the "ioastream" header. That looks like it could be causing your error.
Asked by:
bobbrow commented Sep 20, 2017 •
What does gcc tell you the include path should be? Run this command and make sure all of the paths printed out are listed in your c_cpp_properties.json: gcc -v -E -x c++ -
perryizgr8 commented Oct 10, 2017
This is the output of the g++ command on the Ubuntu machine:
I have / mounted to drive letter Z, so my includePath looks like this:
As you can see, I have translated each path to the equivalent path on my Windows system. I can access the headers using these paths in Windows Explorer, so the path is correct. So even though I can open the iostream header by navigating to "z:\usr\include\x86_64-linux-gnu\c++\5" and opening the file in any editor, VS code still shows a green squiggle below its include.
I am accessing the server over the internet, so I'm worried this might have something to do with VS code being unable to parse files that are slow to read. Is that likely to cause this problem? The fire icon in the bottom right does go away after a while (1-2 min).
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
dorsa1986 commented Oct 2, 2017
This is my tasks.json:
I've been working on this about 4 days. I can't find my mistake.
Asked by:
Файл не включен в путь поиска включаемых файлов
Это указывает компилятору искать файл в том же каталоге, который содержит исходный файл, а затем искать в других местах, заданных средой сборки. Если кавычки содержат абсолютный путь, компилятор выполняет поиск файла только в этом расположении. Если кавычки содержат относительный путь, компилятор выполняет поиск файла в каталоге относительно исходного каталога.
Если имя заключено в угловые скобки,
Если включаемые файлы находятся в другом каталоге относительно исходного каталога и в директивах Include используется относительный путь, то вместо угловых скобок следует использовать двойные кавычки. Например, если файл myheader.h заголовка находится в подкаталоге именованных заголовков проекта, в этом примере не удается найти файл и вызывается C1083:
но этот пример работает:
smithalexk commented Sep 27, 2017
I am also having the issue seen by @NikoGP with my Intellisense after upgrading to v0.13.0. When I turned on the "Default" setting on the Intellisense engine, I keep receiving an iostream include path error (see attached files). I'm running MacOS 10.12.6, and have updated the LLVM engine as well.
Simple "Hello World" example showing the error:
My c_pp_properties.json file:
dorsa1986 commented Oct 2, 2017
@smithalexk Thanks, I corrected but still, I got error
Проблемы с библиотекой сторонних производителей и vcpkg
если вы видите эту ошибку при попытке настроить библиотеку стороннего производителя в рамках сборки, рассмотрите возможность использования vcpkg, диспетчера пакетов C++ для установки и сборки библиотеки. vcpkg поддерживает большой и растущей список библиотек сторонних производителейи задает все свойства конфигурации и зависимости, необходимые для успешной сборки в рамках проекта.
dorsa1986 commented Sep 29, 2017
my c_cpp_properties.json file:
My tasks.json file:
My launch.json file:
My User Setting is:
The path of the FirstProg folder is :
CMake Tools Log
Not sure how to get this log, there is the extension host log:
Other Notes/Information
(I posted this issue on Windows, but I have a Mac Book Pro with Big Sur system having exactly the same problem)
The text was updated successfully, but these errors were encountered:
bobbrow commented Oct 2, 2017
Based on what I see in your previous posts, I'm going to guess that the path should be /Users/dorsat/Desktop/FirstProg/a.out
zeroxia commented May 13, 2021
If I remove the following configuration from workspace settings: .vscode/settings.json
And add c_cpp_properties.json , to specify extra include directory "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.10240.0\\ucrt" :
Then the squiggle disappeared.
But If I add back the configuration provider in .vscode/settings.json , and keep the include directory setting not changed in c_cpp_properties.json , again the squiggle is shown.
Is it possible to not tweak with c_cpp_properties.json , and just let cmake-tools provide all informatin to vscode? Since the building is already successful.
Or is this related to the CMake generator used? Since neither Visual Studio or Xcode would export compile commands.
dorsa1986 commented Oct 2, 2017
I got the same error.
NikoGP commented Sep 20, 2017
Okay, I think that my problem lies in the fact that I had installed cygwin prior to MingW, and then I incorrectly installed the required packages for MingW to properly function.
Is there somewhere that I can find what packages I need to install for VS Code to work properly with MingW?
Expected:
Building and running/debugging are all OK, and F12 goto definition on the standard header files can actually open that file, there should not be any squiggles reported from Intelli-Sense.
Не задана среда командной строки INCLUDE или LIB
Если компилятор вызывается из командной строки, для указания путей поиска часто используются переменные среды. Если путь поиска, описанный в переменной среды include или lib , задан неправильно, может быть сформирована ошибка C1083. Мы настоятельно рекомендуем использовать ярлык командной строки разработчика, чтобы задать базовую среду для сборок с командной строкой. Дополнительные сведения см. в разделе сборка C/C++ в командной строке. Дополнительные сведения об использовании переменных среды см. в разделе инструкции. Использование переменных среды в сборке.
bobbrow commented Oct 10, 2017
Can you share the include path given by g++? Is it the path on the Ubuntu server or the mapped location on Windows? The includePath needs to match the filesystem of the OS you're working on (in this case Windows with the Z: path).
All replies
Welcome to MSDN forum.
According to your description, I might need to confirm some information from you. Which version of Visual Studio do you use? When did your issue appear, for example, change to use other version of operating system or maybe just create a new project after installing VS? Which version of Windows system do you use?
I suggest you could refer to below steps to try to troubleshoot this issue.
Please open Visual Studio -> Tools -> Import and Export Settings… -> select Reset all settings -> Next -> choose “No, just reset settings, overwriting my current settings” -> select Visual C++ -> Finish
Please open your C++ project -> right-click your project -> Properties -> Configuration Properties -> General -> Windows SDK Version -> choose the corresponding version of your computer’s operating system.(like 10.0 latest installed version)
Please open your C++ project -> right-click your project -> Properties -> Configuration Properties -> VC++ Directories -> Executable Directories -> click on the drop down and select “Edit” -> Uncheck “Inherit from parent or project defaults” -> Check “Inherit from parent or project defaults” again -> OK -> Rebuild the project -> close and restart VS to check if this issue could be solved.
Please right-click your project and choose Unload Project -> right-click and then choose Reload Project –> Rebuild Project and check if it could work this time.
Not sure which version of VS do you use. If you use VS 2017 or higher version of VS(like 2019), please open Visual Studio Installer -> find Visual Studio that the version you use -> More -> Repair. If you use VS 2015 or lower version of VS, please open Control Panel -> Programs -> Uninstall a program -> find Microsoft Visual Studio 20XX -> right-click it -> Change -> Repair.
In addition, you could try to create a new C++ project and check if the newly created solution(project) could work well.
Hope all above could help you and any feedback would be great expected.
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Apparent Behavior:
Squiggles are displayed for standard headers, with error message like:
cannot open source file "crtdbg.h" (dependency of "iostream")
bobbrow commented Oct 2, 2017
Open tasks.json or launch.json (in the .vscode folder) and verify that they are correct
GiBg1aN commented Sep 19, 2017
If you are using Linux you have to add the path /usr/include/linux
Возможно, файл заблокирован или используется
Если для изменения или доступа к файлу используется другая программа, файл может быть заблокирован. Попробуйте закрыть файл в другой программе. иногда другая программа может быть Visual Studio сама по себе при использовании параметров параллельной компиляции. Если отключить параметр параллельной сборки, то эта ошибка исчезнет, а это проблема. Эта проблема также может быть вызвана другими системами параллельной сборки. Будьте внимательны при задании зависимостей файлов и проектов, чтобы порядок сборки был правильным. В некоторых случаях рекомендуется создать промежуточный проект для принудительного создания последовательности зависимостей для общего файла, который может быть создан несколькими проектами. Иногда антивирусные программы временно блокируют недавно измененные файлы для проверки. Если возможно, рассмотрите возможность исключения каталогов сборки проекта из антивирусного сканера.
bobbrow commented Oct 2, 2017
@dorsa1986, what does g++ -Wp,-v -E -xc -x c++ /dev/null show as your include path? The "includePath" in your c_cpp_properties.json file should match that.
andreeis commented May 13, 2021 •
@zeroxia, thank you for opening this report. We will investigate and let you know what we find.
In the meantime, we need also another log: run the command "C/C++: Log Diagnostics" from the palette and share with us the content of the "C/C++ Diagnostics" output page (all this is different than the C/C++ output channel, which is also very useful and thank you for providing that).
Did this ever worked before for you or it regressed with 1.7.3 (or any 1.7.*)?
bobbrow commented Sep 20, 2017
I reformatted your comment. There is a "configurations" element inside your "configurations" which is invalid syntax for the c_cpp_properties.json file. Fix it like below:
bobbrow commented Oct 2, 2017
According to that error, either your tasks.json is not building your program correctly, or your launch.json has an incorrect path to the built program. But this is not an issue with IntelliSense. I don't see any red squiggles in your editor.
Пример
В следующем примере создается ошибка C1083, если файл "test.h" заголовка не существует в исходном каталоге или в пути поиска include.
Сведения о том, как создавать проекты C/C++ в интегрированной среде разработки или в командной строке, а также сведения о настройке переменных среды см. в разделе проекты и сборки систем.
bobbrow commented Oct 2, 2017
There should be plenty of websites out there that can walk you through the steps of getting your code to build. This forum is for troubleshooting bugs in the VS Code Extension and your issue doesn't appear to be a bug since it doesn't appear to work for you in the terminal either.
I'm running out of ideas for you, but these came to mind:
- Check your filesystem to make sure the headers are there (look at the include paths that your compiler tells you it's using)
- Did you install XCode, or run xcode-select --install?
- Did you install a different compiler you can try? (your tasks.json references g++, but your terminal screenshots show cpp)
- It looks like you have an a.out in your folder already. How did you get it?
dorsa1986 commented Oct 2, 2017
how can I solve them?
Предкомпилированные заголовки еще не скомпилированы
Если проект настроен для использования предварительно скомпилированных заголовков, необходимо создать соответствующие .pch файлы, чтобы можно было скомпилировать файлы, использующие содержимое заголовка. например, pch.cpp файл ( stdafx.cpp в Visual Studio 2017 и более ранних версий) автоматически создается в каталоге проекта для новых проектов. Сначала необходимо скомпилировать этот файл, чтобы создать предкомпилированные файлы заголовков. В типичном проекте процесса сборки это выполняется автоматически. Дополнительные сведения см. в разделе Создание предкомпилированных файлов заголовков.
bobbrow commented Oct 2, 2017
Did you build it yet? Open your terminal or a Finder window and tell me where your compiled program lives.
perryizgr8 commented Oct 10, 2017
I have followed all the suggestions in this thread and now my browse.path and includePath are same as the entries found using "g++ -Wp,-v -E -xc -x c++ /dev/null".
However, I still cannot include iostream or atomic or stdio, basically any standard header. My own headers from a sub-directory are fine.
To be clear, mine is not a build issue (I'm using my own build system), but an intellisense issue. A peculiarity is that my code resides on a remote Ubuntu server, and I am running VS code on my Windows laptop with the Z: drive mounted to / on the server. I'd be grateful if anybody has any ideas.
Question
I am trying to build a code using VS 2008 professional and windows CE 6.0 SDK.
I am getting one error fatal error C1083: Cannot open include file: 'crtdbg.h': No such file or directory. I have included the following paths in the Tools ->options->VC++ Directories->Include files$(VCInstallDir)ce\include
C:\Program Files\Windows CE Tools\SDKs\Toradex_CE600\include\ARMv4I
C:\Program Files\Windows CE Tools\SDKs\Toradex_CE600\include
$(VCInstallDir)ce\atlmfc\include
$(VSInstallDir)SmartDevices\SDK\SQL Server\Mobile\v3.0
Tools ->options->VC++ Directories->Include files$(VCInstallDir)ce\Library filesC:\Program Files\Windows CE Tools\SDKs\Toradex_CE600\lib\ARMv4I
$(VCInstallDir)ce\atlmfc\lib\ARMv4I
$(VCInstallDir)ce\lib\ARMv4I
Tools ->options->VC++ Directories->Include files$(VCInstallDir)ce\source filesC:\Program Files\Microsoft Visual Studio 9.0\VC\include
$(VCInstallDir)ce\atlmfc\src\atl
$(VCInstallDir)ce\atlmfc\src\mfc
$(VCInstallDir)ce\crt\src
Also the solution->properties->Debug source files has the following paths.
c:\Program Files\Microsoft Visual Studio 9.0\VC\crt\src\
c:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\src\mfc\
c:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\src\atl\
c:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\
C:\Program Files\Microsoft Visual Studio 9.0\VC\include
This file is used in my startup project. My solution has 10 projects(MFC static library). 9 out of 10 are successfully compiled. Just this project is giving this error. Can you please help me.
With the simpliest CMake project, most standard headers, like always get squiggles underlying them.
Both Windows and MacOS have this problem.
There was an issue on vscode-cpp extension project, but closed, I'm not able to find out the solution from it though:
sean-mcmanus commented Oct 2, 2017 •
@dorsa1986 Is a.out the name of the executable? Does it have executable permissions? Can you run it without VS Code from a command line?
Включена неправильная версия имени файла
NikoGP commented Sep 20, 2017 •
Here is my current c_cpp_properties.json file, when I hover over the " Also, I installed cygwin before installing MingW, I'm not sure if that messes anything up or not
dorsa1986 commented Oct 2, 2017
it's my launch.jason file:
Читайте также: