Scope errors while building in platformIO in VSCode

Good morning,
first i wanna say i am new with arduino etc.

I wrote an example snippet to turn off an on an LED. The code is correct.

After building in platformio i get this problems:

WCharacter.h home/devdave/.platformio/packages/framework-arduino-avr/cores/arduino
‘isalnum’ was not declared in this scope
‘isalpha’ was not declared in this scope
‘isascii’ was not declared in this scope
‘isblank’ was not declared in this scope
‘iscntrl’ was not declared in this scope
‘isdigit’ was not declared in this scope
‘isgraph’ was not declared in this scope
‘islower’ was not declared in this scope
‘isprint’ was not declared in this scope
‘ispunct’ was not declared in this scope
‘isspace’ was not declared in this scope
‘isupper’ was not declared in this scope
‘isxdigit’ was not declared in this scope
‘toascii’ was not declared in this scope
‘tolower’ was not declared in this scope
‘toupper’ was not declared in this scope

When clicking on one of these problems i get

Unable to open ‘WCharacter.h’: Unable to read file ‘/home/devdave/dev/platformio/projects/LED_Test/home/devdave/.platformio/packages/framework-arduino-avr/cores/arduino/WCharacter.h’ (Error: Unable to resolve non-existing file ‘/home/devdave/dev/platformio/projects/LED_Test/home/devdave/.platformio/packages/framework-arduino-avr/cores/arduino/WCharacter.h’).

It seems platformio is looking for the header file WCharacter.h in the wrong directory.
The file /home/devdave/dev/platformio/projects/LED_Test/home/devdave/.platformio/packages/framework-arduino-avr/cores/arduino/WCharacter.h’ doesnt exists because its in home/devdave/.platformio/packages/framework-arduino-avr/cores/arduino/WCharacter.h’…

hope somebody can help
Tank you

Please do a Ctrl+Shift+P → Rebuild IntelliSense. Is the error still there?

Then post the .vscode/c_cpp_properties.json along with the version info your VSCode installation (about page).

Error still there but there is online Rebuild IntelliSense Index…

c-cpp_properties:

//
// !!! WARNING !!! AUTO-GENERATED FILE!
// PLEASE DO NOT MODIFY IT AND USE "platformio.ini":
// https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags
//
{
    "configurations": [
        {
            "name": "PlatformIO",
            "includePath": [
                "/home/devDave/dev/platformio/projects/LED_Test/include",
                "/home/devDave/dev/platformio/projects/LED_Test/src",
                "/home/devDave/.platformio/packages/framework-arduino-avr/cores/arduino",
                "/home/devDave/.platformio/packages/framework-arduino-avr/variants/eightanaloginputs",
                "/home/devDave/.platformio/packages/framework-arduino-avr/libraries/EEPROM/src",
                "/home/devDave/.platformio/packages/framework-arduino-avr/libraries/HID/src",
                "/home/devDave/.platformio/packages/framework-arduino-avr/libraries/SPI/src",
                "/home/devDave/.platformio/packages/framework-arduino-avr/libraries/SoftwareSerial/src",
                "/home/devDave/.platformio/packages/framework-arduino-avr/libraries/Wire/src",
                ""
            ],
            "browse": {
                "limitSymbolsToIncludedHeaders": true,
                "path": [
                    "/home/devDave/dev/platformio/projects/LED_Test/include",
                    "/home/devDave/dev/platformio/projects/LED_Test/src",
                    "/home/devDave/.platformio/packages/framework-arduino-avr/cores/arduino",
                    "/home/devDave/.platformio/packages/framework-arduino-avr/variants/eightanaloginputs",
                    "/home/devDave/.platformio/packages/framework-arduino-avr/libraries/EEPROM/src",
                    "/home/devDave/.platformio/packages/framework-arduino-avr/libraries/HID/src",
                    "/home/devDave/.platformio/packages/framework-arduino-avr/libraries/SPI/src",
                    "/home/devDave/.platformio/packages/framework-arduino-avr/libraries/SoftwareSerial/src",
                    "/home/devDave/.platformio/packages/framework-arduino-avr/libraries/Wire/src",
                    ""
                ]
            },
            "defines": [
                "PLATFORMIO=50101",
                "ARDUINO_AVR_NANO",
                "F_CPU=16000000L",
                "ARDUINO_ARCH_AVR",
                "ARDUINO=10808",
                "__AVR_ATmega328P__",
                ""
            ],
            "cStandard": "c11",
            "cppStandard": "c++11",
            "compilerPath": "/home/devDave/.platformio/packages/toolchain-atmelavr/bin/avr-gcc",
            "compilerArgs": [
                "-mmcu=atmega328p",
                ""
            ]
        }
    ],
    "version": 4
}

Version: 1.58.2
Commit: c3f126316369cd610563c75b1b1725e0679adfb3
Date: 2021-07-14T22:30:16.440Z
Electron: 12.0.13
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Linux x64 5.8.0-63-generic

The paths there are all correct, and that was generated by PlatformIO. So the error has to lie elsewhere.

What extensions of which exact version have you installed in VSCode?

1 Like

vscode 1.58.2
C/C++ IntelliSense v1.5.1
platformio v2.3.2

The strange thing is this is my work computer. On my Homecomputer everything is working. At work i installed this kubunto and all the other packages not my self…
So i think there is something happen

Are there any symlink involved in the paths? Like /home/devDave/dev/platformio/projects/LED_Test?

Have to wait til thuesday. Weekend now :slight_smile: