ESP32 linker error (undefined reference) using platformio on VS Code

Hello,

I’m just starting to use Platformio and haven’t had too much luck yet. I’m pretty confident that once I can get my environment set up correctly things will go more smoothly. At the moment I’m able to compile the code that I have linked below, but I get a linker error. I don’t actually think it’s a FastLED library thing and more how I have platformio and/or vscode setup.

The linker doesn’t seem to be able to find a bunch of references. The first error being:

`undefined reference to \ESP32RMTController::getPixelBuffer(int)'``

There are many other undefined references, but the all seem to follow the same pattern. I think I have an issue with the source path being added but the linker maybe can’t find the objects.

My platformio.ini is:
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
build_flags =
-I…/FastLED/src
-L…/FastLED/src

Code: #include <Arduino.h>#include <FastLED.h>// GPIO for LED on development boa - Pastebin.com

Error: > Executing task in folder table_lights: C:\Users\username\.platformio\penv\Scri - Pastebin.com

I really hope this is formatted correctly, I couldn’t find a preview

Oh no – you can’t add an out-of-tree source directory with the -L option, this option is for adding a path to the static library search path, aka, when the project e.g. links with -lsomelib it searches these paths for libsomelib.a.

Please use the regular library management methods via lib_deps and the library registry.

Per FastLED install page your platformio.ini should be

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
lib_deps = 
     fastled/FastLED @ ^3.4.0

Thank you for the prompt and clear reply. Sometimes there’s just so much documentation that it’s easy to get lost when you’re starting out.

This has resolved my problem.