Libraries are declared "Framework incompatible", ESP32 is not defined

When I clean all/build, the libraries get installed but are declared “Framework incompatible”. Then the associated include files are not found, e.g. FastLED.h, and the build fails.

Here’s my platform.ini:

platform = espressif32
board = wemos_d1_mini32
framework = espidf
lib_deps = 
lib_compat_mode = off

Note I turned lib_compat_mode off temporarily, but it fails without that directive too. I’ve tried other libraries (that I’m not using), and they also show as incompatible.

At one point this project was compiling, downloading and running on an espressif devkit-1. I broke it and ended up down the rabbit hole, then vscode offered to help by installing the cmake extension and configuring all my projects for me. It sounded like a good idea at the time. I’ve since learned that cmake is installed with platformio and I’ve uninstalled the cmake extension. But I sifted through and tweaked a lot of vscode settings along the way. I’m sure I could reinstall everything from scratch and I might do that eventually anyway. But I’d like to understand what I did wrong. I’ve uninstalled/reinstalled the platformio extension, recreated the project, deleted .pio, .vscode, CMakeList files, and builds still fail in the same way.

When I turned off lib_compat_mode, I got a little further, for instance FastLED.h is found but then this line in led_sysdefs.h is hit:

55   #error "This platform isn't recognized by FastLED... yet

which means ESP32 was not defined earlier at:

35   #elif defined(ESP32)

I assume that ESP32 should get defined somewhere based on my choice of platform, board and framework. But I can’t find where that happens.

I’m running vscode V1.70.2, platformio Core 6.1.4/Home 3.4.3. I’m new to vscode but I’ve used a lot of IDEs over the years.

Actually that is only defined when using the Arduino framework, see

You can add in your project by adding

build_flags = -DESP32

in your platformio.ini.

Yep, Arduino framework, fastled/FastLED3.5.0 doesn’t appear to be ready for ESP-IDF. There are compatible ports, but that’s not what I pulled in. I was originally using the Arduino framework, that’s why it “used to work”.

P.S. here’s the original build log, which I should have included in my first post. The last line says it all

Processing esp32doit-devkit-v1 (platform: espressif32; board: esp32doit-devkit-v1; framework: espidf)
Library Manager: Installing fastled/FastLED @ ^3.5.0
Unpacking  [####################################]  100%
Library Manager: FastLED@3.5.0 has been installed!
Verbose mode can be enabled via `-v, --verbose` option
PLATFORM: Espressif 32 (5.1.0) > DOIT ESP32 DEVKIT V1
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
 - framework-espidf @ 3.40401.0 (4.4.1) 
 - tool-cmake @ 3.16.4 
 - tool-esptoolpy @ 1.30300.0 (3.3.0) 
 - tool-ninja @ 1.9.0 
 - toolchain-esp32ulp @ 1.22851.191205 (2.28.51) 
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3

[notice] A new release of pip available: 22.2.1 -> 22.2.2
[notice] To update, run: pip install --upgrade pip
Reading CMake configuration...
Generating assembly for certificate bundle...
LDF: Library Dependency Finder ->
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries