CLion can't find lib_deps library headers

I’m using PlatformIO with CLion, and my project has an external dependency in lib_deps (ESPAsyncWebServer). However when I include this header in my main.cpp and I try to use it, CLion acts as if the header doesn’t even exist, and gives me all sorts of red squiggly lines. PlatofmrIO can still compile and upload the project without any problems, so I think this is just a CLion issue.

One workaround is to include the file like this:

#include "../.pio/libdeps/esp32thing/ESP Async WebServer/src/ESPAsyncWebServer.h"

instead of this:

#include <ESPAsyncWebServer.h>

This way I can at least get IntelliSense for the library functions, and I can still upload the project on my dev board, but this is kind of a nasty workaround, and I’m hoping that there is something in CLion’s settings that I can tweak to make it recognize header files in .pio/libdeps.

Built-in headers like Arduino.h, FS.h, WiFi.h are correctly recognized by IntellySense, it’s only having problems with the ESPAsyncWebServer library added with lib_deps.

Here’s my platformio.ini file:

[env:esp32thing]
platform = espressif32
board = esp32thing
framework = arduino
upload_port = COM8
monitor_port = COM8
monitor_speed = 115200
board_build.partitions = huge_app.csv
lib_deps =
    WiFi
    FS
    https://github.com/me-no-dev/ESPAsyncWebServer.git

Some additional info:

  • MCU: ESP32 (Adafruit HUZZAH32, Adafruit ESP32 Thing in PlatformIO)
  • Framework: Arduino
  • CLion: 2021.2.2
  • Toolchain: MinGW
  • CMake profile: esp32thing

No.

Just reload the IntelliSense. It’s the nature of the LDF to find only libraries after they were 1. added to lib_deps 2. included in the firmware code 3. intellisense was reloaded.

grafik

2 Likes

Thank you, this solved it!