Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 
(연관된 글이 3개 있습니다.)

Visual Studio Code extension for Arduino - #include errors detected.

이상하군요. 다음과 같은 오류가 발생하는데,

vs_code_include_error_1.png

Configure your IntelliSense settings to help find missing headers.

Source C/C++ (Extension)

붉은 밑줄이 있는 "void setup()" 위에 마우스를 올려놓으니 이런 오류 메시지가 나타납니다.

#include errors detected. Please update your includePath. IntelliSense features for this translation unit (%USERPROFILE%\Documents\Arduino\generated_examples\Blink\Blink.ino) will be provided by the Tag Parser.

cannot open source file "avr/pgmspace.h" (dependency of "C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\Arduino.h")


더욱 이상한 것은, 위의 프로젝트는 c:\temp\My 폴더에 있는 My.ino인데, 엉뚱하게 %USERPROFILE%\Documents\Arduino\generated_examples\Blink\Blink.ino 파일의 경로가 나오는 것입니다. 혹시나 해서, %USERPROFILE%\Documents\Arduino\generated_examples\Blink 폴더를 삭제했더니 이제는 다음과 같이 오류 메시지가 바뀝니다.

#include errors detected. Please update your includePath. IntelliSense features for this translation unit (C:\temp\My\My.ino) will be provided by the Tag Parser.

cannot open source file "avr/pgmspace.h" (dependency of "C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\Arduino.h")


우선, 두 번째 오류는 ./.vscode/settings.json 파일을 통해 "Workspace Settings" 수준으로 C_Cpp.intelliSenseEngineFallback 설정을 하면 없어집니다. (settings.json 파일이 없는 경우 그냥 만들거나 Command Palette을 통해 "> Preferences: Open Settings (JSON)" 명령을 실행합니다.)

{
    "C_Cpp.intelliSenseEngineFallback": "Disabled"
}

첫 번째 오류는 해결 방법이 상황에 따라 달라질 수 있을 것 같은데, 일단 제 경우에는 다음과 같이 2개의 include 폴더를 추가했을 때 없어졌습니다.

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "C:\\Program Files (x86)\\Arduino\\tools\\**",
                "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\**",
                "C:/Program Files (x86)/Arduino/hardware/tools/avr/avr/include",
                "C:/Program Files (x86)/Arduino/hardware/arduino/avr/variants/circuitplay32u4"
            ],
            "forcedInclude": [
                "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino\\Arduino.h"
            ],
            "intelliSenseMode": "msvc-x64",
            "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.15.26726/bin/Hostx64/x64/cl.exe",
            "cStandard": "c11",
            "cppStandard": "c++17"
        }
    ],
    "version": 4
}

재미있는 것은, 첫 번째 문제를 해결하면 두 번째의 settings.json 설정을 하지 않아도 됩니다. 음... 보면 볼수록 이상하군요. ^^ /avr/avr/include 폴더는 그렇다 쳐도 /avr/variants 폴더는 그 상위에 있는 avr\\** 설정에 포함이 되는데도 다시 해줘야만 합니다.




참고로, 이번 2개의 오류는 사실 발생했다고 해도 그다지 개발에 영향을 주는 것은 아니고 IntelliSense에만 약간 문제가 발생합니다. 중요 작업인 컴파일 및 업로드가 잘 되므로 고치지 않아도 상관없지만 그래도 빨간 줄이 그어지는 것을 참고 못 보는 분들이라면 ^^ 이런 유의 작업을 해줘야만 합니다.




Visual Studio Code를 이용한 아두이노 프로그램 개발
; https://www.sysnet.pe.kr/2/0/11753

Visual Studio Code를 이용한 아두이노 프로그램 개발 - 새 프로젝트
; https://www.sysnet.pe.kr/2/0/11754

Visual Studio Code의 아두이노 프로그램 개발 시 인텔리센스가 안 된다면?
; https://www.sysnet.pe.kr/2/0/11756

Visual Studio Code extension for Arduino - #include errors detected.
; https://www.sysnet.pe.kr/2/0/11755




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]

[연관 글]






[최초 등록일: ]
[최종 수정일: 10/19/2018]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 



2019-08-05 04시11분
[나그네] VSCode 버그인거 같습니다. 보통 코드 수정없이 VSCode를 재시작하면 사라지더군요.

[guest]

... 166  167  168  169  170  171  172  173  174  175  176  177  [178]  179  180  ...
NoWriterDateCnt.TitleFile(s)
594정성태9/22/200823156.NET Framework: 104. Win32Exception 클래스 소개
591정성태7/24/200819787오류 유형: 57. VS.NET 2008 TFC - 체크인 시에 비프 음과 함께 정지되는 현상
592정성태7/28/200819692    답변글 오류 유형: 57.1. VS.NET 2008 TFC - 체크인 시에 비프 음과 함께 정지되는 현상 [1]
590정성태7/20/200825701.NET Framework: 103. WPF - ControlTemplate을 코드에서 다뤄보기 [1]
589정성태6/17/200822238.NET Framework: 102. COM 개체의 이벤트를 구독하는 코드 제작 [1]
588정성태6/13/200824264VC++: 35. COM 이벤트에서 반환값을 가진 콜백 정의
587정성태6/10/200828920VS.NET IDE: 56. C#에서 아쉬운 __DATE__, __TIME__ 매크로 [2]
586정성태6/4/200826624오류 유형: 56. WPF 디자이너 - The string was not recognized as a valid DateTime [2]
585정성태6/4/200834901.NET Framework: 101. WPF - ActiveX 컨트롤 호스팅하는 방법 [2]
582정성태5/16/200826616오류 유형: 55. Windowless ActiveX controls are not supported
580정성태4/24/200825667VC++: 34. 64비트 윈도우즈에서의 이벤트 후킹
579정성태4/24/200825494VC++: 33. 변환 후의 RGS 파일 내용을 얻는 방법
577정성태4/16/200826425.NET Framework: 100. XML Serializer를 이용한 값 복사 [5]
575정성태4/7/200823655오류 유형: 54. TFS Source Control - 명령을 사용할 수 없음 [2]
574정성태3/31/200821691오류 유형: 53. TFS 연결 오류 - The workspace [...] exists on computer [...]
573정성태3/25/200825750Windows: 31. TS Web Access와 UAC [1]
570정성태3/17/200824876오류 유형: 52. TFS 연결 오류 - TF31001 [2]
569정성태3/16/200826091Team Foundation Server: 24. TFS 2008로 마이그레이션 (2) [2]
566정성태2/28/200827142.NET Framework: 99. AppDomain.GetEntryAssembly()를 우회하는 방법파일 다운로드1
564정성태2/16/200826777Windows: 30. TS Web Access + Vista SP1 [2]
563정성태2/16/200826181오류 유형: 51. Vista(UAC) + 웹 프로젝트 디버깅: System.UnauthorizedAccessException
562정성태2/12/200830377Windows: 29. Windows Server 2008 설치 [4]
561정성태1/10/200824171오류 유형: 50. IE 7 + 잘못된 HTC 파일 경로 = File not found [5]
559정성태1/1/200828939Windows: 28. Vista에서 끌어다 놓기로 GAC 등록하는 방법 [2]
558정성태1/1/200846101개발 환경 구성: 33. 32bit/64bit OLE DB Provider [1]
557정성태12/22/200724460개발 환경 구성: 32. WSCF와 VS.NET 2008
... 166  167  168  169  170  171  172  173  174  175  176  177  [178]  179  180  ...