How to use different lib versions with same name in one project?



I want to use two different versions of one library in one project.
The libs are:
official FastLED:
inofficial Fork for RGBW:

I defined different enviroments like this:

lib_deps =

lib_deps =
  1. I hoped the alternative library would be installed to .piolibdeps\FastLED_RGBW\ instead of .piolibdeps\FastLED\
  2. But even if it did, I think #include <FastLED.h> would still call the official library, right?

I would like to use something like this:

build_flags = -D RGBW
lib_deps =
#ifdef RGBW
   #include <FastLED_RGBW/FastLED.h>
  #include <FastLED.h>

So, how do I do this the right way?
Or do I have to use different project folders where only one FastLED exists?


lib_extra_dirs is the config option you want.

Don’t use the ‘lib’ dir. Make lib1, lib2, … in your project folder. Under your board settings use ‘lib_extra_dir = lib1’ and so on.


This is a bug and has been just fixed