PlatformIO Community

No definition found

W10 64, Core 5.2.0b1, Home 3.3.4
I have project with some libraries defined in platformio.ini via lib_deps.
I can build project and load it to the esp8266. It is working but I can’t use F12 on some libraries in the code. They are not highlighted as “known” library.
What is strange, that I have my own header file with some defined variables like #define LED_PIN 15.
This header is included in the main.cpp file but when I hit F12 (focus on LED_PIN) I get “No definition found for ‘LED_PIN’”. But as I mentioned I can compile it with no errors !!!

This project has located on my D drive (physical) in some directories. When I moved whole project to the c:\Users{user}\Documents\PlatformIO then everything work OK !!!.
I also checked c_cpp_properties.json and all paths are OK.
I did delete whole .pio folder to get fresh libraries, but did not help on D drive.
Can somebody tell what I’m missing here ?
Thank you in advance.
Dan

So, what’s the platformio.ini, code and definition you’re trying to follow?

I have to use D drive as development drive, so I can’t move projects.
What I’m missing is that I can’t get property, functions… for instances I’m creating in my code.
Strange thing is that some libraries are OK and some not, but I can compile code. I have to remember
properties I want to use and all parameters … it is not helping me.

I didn’t ask you to move the project, I asked you to show the platformio.ini, code and the definition you’re trying to follow :smiley:

platformio.ini

[env:Wire_HB3]
platform = espressif8266
board = nodemcuv2
framework = arduino
monitor_speed = 115200
board_build.f_cpu = 160000000L
upload_speed = 921600
lib_deps = 
  adafruit/Adafruit GFX Library@^1.10.5
  adafruit/Adafruit ST7735 and ST7789 Library@^1.6.0
  bblanchon/ArduinoJson@^6.18.3
  tzapu/WiFiManager @ ^0.16.0
  plerup/EspSoftwareSerial@^6.11.4

code

And I have already rebuild intellisense index many times :frowning:

Works for me.

  1. Make sure you’ve switched to the correct project + environment using the project environment switcher
  2. Build the project once to ensure all libraries are downloaded.
  3. Issue a rebuild intellise command (Ctrl+Shift+P → Rebuild IntelliSense)
  4. Make sure your code file is a .cpp file, not .ino.

It should look like

grafik

If that is not the case, you may have conflicting VSCode extensions installed.

Thank you for your answer.

Works for me on C drive too :slight_smile:

  1. I have only one project open and one project env
  2. as I mentioned I deleted all .pio directory to get fresh libraries
  3. I did it many times - not help
  4. My file is main.cpp

Why is this working on C drive when I just copy whole project to the Documents\PlatformIO folder ?
Any PATH variable missing ?

I removed the project from the VSCode workspace, moved it the D: drive, used the PIO Home → Open Project button to re-import it, then re-selected the Wire_HB3 environment in the project environment switcher, and I’m back to a working setup. Deleting the .vscode/c_cpp_properties.json and issuing a rebuild also correctly re-creates the file.

grafik

Can you show a complete screenshot of VScode and the contents of the c_cpp_properties.json?

I have deleted also c_cpp_properties.json file and again all files in .pio dir.
Now I’m getting this error (first time !!)
dev

Add adafruit/Adafruit BusIO @ ^1.9.1 to th lib_deps.

It helps to compile, link and build project with no errors. But the “No definition found” is still there :slight_smile:

^this here pls — (blah blah 20 chars)

vscode

//

// !!! 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": [
                "D:/DS/Elektrika/projekty/Zumpa/HomeBase/Wire_HB3/include",
                "D:/DS/Elektrika/projekty/Zumpa/HomeBase/Wire_HB3/src",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266httpUpdate/src",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266HTTPClient/src",
                "D:/DS/Elektrika/projekty/Zumpa/HomeBase/Wire_HB3/.pio/libdeps/Wire_HB3/EspSoftwareSerial/src",
                "D:/DS/Elektrika/projekty/Zumpa/HomeBase/Wire_HB3/.pio/libdeps/Wire_HB3/WiFiManager",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WebServer/src",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/DNSServer/src",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi/src",
                "D:/DS/Elektrika/projekty/Zumpa/HomeBase/Wire_HB3/.pio/libdeps/Wire_HB3/ArduinoJson/src",
                "D:/DS/Elektrika/projekty/Zumpa/HomeBase/Wire_HB3/.pio/libdeps/Wire_HB3/Adafruit ST7735 and ST7789 Library",
                "D:/DS/Elektrika/projekty/Zumpa/HomeBase/Wire_HB3/.pio/libdeps/Wire_HB3/Adafruit GFX Library",
                "D:/DS/Elektrika/projekty/Zumpa/HomeBase/Wire_HB3/.pio/libdeps/Wire_HB3/Adafruit BusIO",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/Wire",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/SPI",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/tools/sdk/include",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/cores/esp8266",
                "C:/Users/DS/.platformio/packages/toolchain-xtensa/include",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/tools/sdk/lwip2/include",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/variants/nodemcu",
                "D:/DS/Elektrika/projekty/Zumpa/HomeBase/Wire_HB3/.pio/libdeps/Wire_HB3/Adafruit seesaw Library",
                "D:/DS/Elektrika/projekty/Zumpa/HomeBase/Wire_HB3/.pio/libdeps/Wire_HB3/SD",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/ArduinoOTA",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/EEPROM",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266AVRISP/src",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266HTTPUpdateServer/src",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266LLMNR",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266NetBIOS",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266SSDP",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266SdFat/src",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFiMesh/src",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266mDNS/src",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/Ethernet/src",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/GDBStub/src",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/Hash/src",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/I2S/src",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/LittleFS/src",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/Netdump/src",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/SD/src",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/SDFS/src",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/SPISlave/src",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/Servo/src",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/SoftwareSerial/src",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/TFT_Touch_Shield_V2",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/Ticker/src",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/esp8266/src",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/lwIP_PPP/src",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/lwIP_enc28j60/src",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/lwIP_w5100/src",
                "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/lwIP_w5500/src",
                "C:/Users/DS/.platformio/packages/tool-unity",
                ""
            ],
            "browse": {
                "limitSymbolsToIncludedHeaders": true,
                "path": [
                    "D:/DS/Elektrika/projekty/Zumpa/HomeBase/Wire_HB3/include",
                    "D:/DS/Elektrika/projekty/Zumpa/HomeBase/Wire_HB3/src",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266httpUpdate/src",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266HTTPClient/src",
                    "D:/DS/Elektrika/projekty/Zumpa/HomeBase/Wire_HB3/.pio/libdeps/Wire_HB3/EspSoftwareSerial/src",
                    "D:/DS/Elektrika/projekty/Zumpa/HomeBase/Wire_HB3/.pio/libdeps/Wire_HB3/WiFiManager",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WebServer/src",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/DNSServer/src",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi/src",
                    "D:/DS/Elektrika/projekty/Zumpa/HomeBase/Wire_HB3/.pio/libdeps/Wire_HB3/ArduinoJson/src",
                    "D:/DS/Elektrika/projekty/Zumpa/HomeBase/Wire_HB3/.pio/libdeps/Wire_HB3/Adafruit ST7735 and ST7789 Library",
                    "D:/DS/Elektrika/projekty/Zumpa/HomeBase/Wire_HB3/.pio/libdeps/Wire_HB3/Adafruit GFX Library",
                    "D:/DS/Elektrika/projekty/Zumpa/HomeBase/Wire_HB3/.pio/libdeps/Wire_HB3/Adafruit BusIO",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/Wire",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/SPI",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/tools/sdk/include",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/cores/esp8266",
                    "C:/Users/DS/.platformio/packages/toolchain-xtensa/include",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/tools/sdk/lwip2/include",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/variants/nodemcu",
                    "D:/DS/Elektrika/projekty/Zumpa/HomeBase/Wire_HB3/.pio/libdeps/Wire_HB3/Adafruit seesaw Library",
                    "D:/DS/Elektrika/projekty/Zumpa/HomeBase/Wire_HB3/.pio/libdeps/Wire_HB3/SD",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/ArduinoOTA",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/EEPROM",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266AVRISP/src",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266HTTPUpdateServer/src",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266LLMNR",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266NetBIOS",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266SSDP",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266SdFat/src",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFiMesh/src",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266mDNS/src",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/Ethernet/src",

                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/GDBStub/src",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/Hash/src",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/I2S/src",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/LittleFS/src",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/Netdump/src",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/SD/src",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/SDFS/src",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/SPISlave/src",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/Servo/src",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/SoftwareSerial/src",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/TFT_Touch_Shield_V2",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/Ticker/src",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/esp8266/src",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/lwIP_PPP/src",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/lwIP_enc28j60/src",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/lwIP_w5100/src",
                    "C:/Users/DS/.platformio/packages/framework-arduinoespressif8266/libraries/lwIP_w5500/src",
                    "C:/Users/DS/.platformio/packages/tool-unity",
                    ""
                ]
            },
            "defines": [
                "PLATFORMIO=50200",
                "ESP8266",
                "ARDUINO_ARCH_ESP8266",
                "ARDUINO_ESP8266_NODEMCU_ESP12E",
                "F_CPU=160000000L",
                "__ets__",
                "ICACHE_FLASH",
                "ARDUINO=10805",
                "ARDUINO_BOARD=\"PLATFORMIO_NODEMCUV2\"",
                "FLASHMODE_DIO",
                "LWIP_OPEN_SRC",
                "NONOSDK22x_190703=1",
                "TCP_MSS=536",
                "LWIP_FEATURES=1",
                "LWIP_IPV6=0",
                "VTABLES_IN_FLASH",
                "MMU_IRAM_SIZE=0x8000",
                "MMU_ICACHE_SIZE=0x8000",
                ""
            ],
            "cStandard": "c17",
            "cppStandard": "c++17",
            "compilerPath": "C:/Users/DS/.platformio/packages/toolchain-xtensa/bin/xtensa-lx106-elf-gcc.exe",
            "compilerArgs": [
                "-mlongcalls",
                "-mtext-section-literals",
                ""
            ]
        }
    ],
    "version": 4
}

Use the project environment switcher to switch away from the “Default” environment to the explicit Wire_HB3 env.

I do not know how to delete “Default” env. But anyway I’m building project from Wire_HB3 env.
build

You don’t have to delete it, just click on the project environment switcher and select the env:Wire_HB3 one

grafik

grafik

Done.
env
Build it. Same :frowning:

List of installed extensions?

Version of VSCode?

How can I get list of installed extensions ?

  • Core 5.2.0b1
  • ·
  • Home 3.3.4

Version: 1.60.0 (system setup)
Commit: e7d7e9a9348e6a8cc8c03f877d39cb72e5dfb1ff
Date: 2021-09-01T10:41:52.311Z
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19042

Just a screenshot of the “Extensions” sidebar in VSCode.