본문 바로가기
C++

VSCode 파일 소스을(를) 열 수 없습니다.

by _은하별사탕_ 2020. 5. 28.

 

오늘 잘 사용해왔다가 vscode 업데이트를 누르면서 include 밑에 물결줄 에러가 발생했다ㅠㅠㅠ

에디터여서 가벼워도 설정은 번거로운..

 

 

 

 

 

에러 내용 :

#include 오류가 검색되었습니다. includePath를 업데이트하세요.

파일 소스을(를) 열 수 없습니다. "crtdbg.h"

파일 소스을(를) 열 수 없습니다. "ctype.h"

 

 

 

아래 링크에서 해결방법을 알아낼 수 있었는데

 

https://developercommunity.visualstudio.com/content/problem/982183/fatal-error-c1083-cannot-open-include-file-crtdbgh.html

 

fatal error C1083: Cannot open include file: 'crtdbg.h': No such file or directory - Developer Community

Sign in Visual Studio Visual Studio for Mac .NET C++ Azure DevOps Azure DevOps Server (TFS) Topics Problems Features Users Badges

developercommunity.visualstudio.com

 

 

 

1) Window10 SDK를 설치한 후

 

https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk/

 

Windows 10 SDK - Windows app development

Windows App Certification Kit In this release of the Windows SDK, several new APIs were added to the Supported APIs list in the App Certification Kit and Windows Store. If there are APIs in the supported list that appear greyed out or disabled in Visual St

developer.microsoft.com

 

 

2) SDK의 C++ header 파일이 있는 경로를 include에 추가해준다

 

SDK 설치 경로를 별도로 변경 안했다면

C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt

의 경로일 것인데

 

c_cpp_properties.json 의 includepath에 아래 처럼 추가해준다

 

 

경로를 추가하면 에러가 해결됨을 볼 수 있을 것이다

 

 

아래는 c_cpp_properties.json 설정 코드 내용이다

 

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "C:\\Program Files (x86)\\mingw-w64\\i686-8.1.0-posix-dwarf-rt_v6-rev0\\mingw32\\lib\\gcc\\i686-w64-mingw32\\8.1.0\\include",
                "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0\\ucrt"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "browse": {
                "limitSymbolsToIncludedHeaders": true,
                "databaseFilename": "${default}",
                "path": [
                    "${workspaceRoot}",
                    "C:\\Program Files (x86)\\mingw-w64\\i686-8.1.0-posix-dwarf-rt_v6-rev0\\mingw32\\lib\\gcc\\i686-w64-mingw32\\8.1.0\\include\\c++"
                ]
            },
            "compilerPath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.26.28801\\bin\\Hostx64\\x64\\cl.exe",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "msvc-x64"
        }
    ],
    "version": 4
}

'C++' 카테고리의 다른 글

반복문에서의 Vector 요소 삭제  (0) 2020.05.22
Visual Code 환경 설정  (0) 2020.05.21