0

I am trying to swap from coding my project in the regular Arduino IDE to VS Code. I am having an issue with the application trying to find header files I believe, although I'm not 100% sure on that. The primary error is as below:

{
    "resource": "/e:/ArduinoProjects/ROMI/linefollow/encoders.h",
    "owner": "C/C++",
    "code": "1696",
    "severity": 8,
    "message": "#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (E:\\ArduinoProjects\\ROMI\\linefollow\\linefollow_main.ino).",
    "source": "C/C++",
    "startLineNumber": 1,
    "startColumn": 1,
    "endLineNumber": 1,
    "endColumn": 1
}

I'm not sure what it means by "includePath". I have set up my json files as below. This is my first time using VS Code, and as such using json files, so I'm guessing it's likely this is where I'm having my issues. The first, settings.json.

{
"arduino.path": "C:/Program Files (x86)/Arduino",
"arduino.commandPath": "arduino_debug.exe",
"arduino.logLevel": "info",
"arduino.allowPDEFiletype": false, 
"arduino.enableUSBDetection": true,
"arduino.disableTestingOpen": false,
"arduino.skipHeaderProvider": false,
"arduino.additionalUrls": [
    "https://raw.githubusercontent.com/VSChina/azureiotdevkit_tools/master/package_azureboard_index.json",
    "http://arduino.esp8266.com/stable/package_esp8266com_index.json"
],
"arduino.defaultBaudRate": 115200

}

c_cpp_properties.json:

{
"configurations": [
    {
        "name": "Win32",
        "includePath": [
            "${workspaceFolder}\\**",
            "C:\\Program Files (x86)\\Arduion\\hardware\\arduino\\avr\\cores\\arduino",
            "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\EEPROM\\src",
            "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\HID\\src",
            "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SoftwareSerial\\src",
            "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src",
            "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\Wire\\src",
            "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src",
            "C:\\Program Files (x86)\\Arduino\\libraries\\Romi 32U4 Arduino Library"
        ],
        "defines": [
            "_DEBUG",
            "UNICODE",
            "_UNICODE",
            "F_CPU=16000000L",
            "ARDUINO=10805",
            "ARDUINO_AVR_UNO",
            "ARDUINO_ARCH_AVR"
        ],
        "compilerPath": "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr\\bin\\avr-gcc.exe",
        "cStandard": "c11",
        "cppStandard": "c++17",
        "intelliSenseMode": "clang-x64",
        "forcedInclude": [
            "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino\\Arduino.h"
        ],

    "browse": {
        "limitSymbolsToIncludedHeaders": false,
        "path": [
            "${workspaceFolder}\\**",
            "C:\\Program Files (x86)\\Arduion\\hardware\\arduino\\avr\\cores\\arduino",
            "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\EEPROM\\src",
            "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\HID\\src",
            "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SoftwareSerial\\src",
            "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src",
            "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\Wire\\src",
            "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src",
            "C:\\Program Files (x86)\\Arduino\\libraries\\Romi 32U4 Arduino Library"
        ]
    }
}   
],
"version": 4

}

arduino.json

    {
    "sketch": "linefollow_main.ino",
    "port": "COM5",
    "board": "arduino:avr:leonardo",
    "output": "../build",
    "debugger": "jlink",
    "prebuild": "bash prebuild.sh"
}

When following the suggested fix, it brings me to this page, but I'm not sure what to do from there.

Any and all help is very much appreciated.

lweight
  • 21
  • 5
  • Possible duplicate: https://stackoverflow.com/questions/51227662/vscode-include-errors-detected-please-update-your-includepath – Scott McPeak Mar 13 '20 at 23:03
  • Following the advice from that, I have implemented the steps as per this walkthrough: https://code.visualstudio.com/docs/cpp/config-mingw with no luck. I'm still getting a, "includePath" error. – lweight Mar 14 '20 at 00:16
  • One of the pieces of advice in the answer in the linked question is to make sure the output of "C/C++: Log Diagnostics" agrees with the output of "gcc -v -E -dD empty.c" (`avg-gcc`.exe in your case). Have you done that? Consider adding the diagnostic output to your question. Also, when VSCode says "include errors detected", usually you can hover the mouse on the error report in the editor to get more information. Consider adding a screenshot of hovering the mouse on the error. – Scott McPeak Mar 14 '20 at 00:34

0 Answers0