Error connecting Circuit Playground Express to Arduino IDE on Raspberry Pi 4

Keep getting ‘Error compiling for board Adafruit Circuit Playground Express’ when trying to upload code to it. It works with my Windows 10 pc just not on Pi.

In file included from sketch/Hello_Blink.ino.cpp:1:0:
/home/pi/.arduino15/packages/arduino/hardware/samd/1.8.6/cores/arduino/Arduino.h:124:0: warning: “digitalPinToInterrupt” redefined
#define digitalPinToInterrupt(P) ( P )

In file included from /home/pi/.arduino15/packages/arduino/hardware/samd/1.8.6/cores/arduino/delay.h:23:0,
from /home/pi/.arduino15/packages/arduino/hardware/samd/1.8.6/cores/arduino/Arduino.h:81,
from sketch/Hello_Blink.ino.cpp:1:
/home/pi/.arduino15/packages/arduino/hardware/samd/1.8.6/variants/circuitplay/variant.h:57:0: note: this is the location of the previous definition
#define digitalPinToInterrupt(P) (g_APinDescription[P].ulExtInt)

In file included from /tmp/arduino-1.8.12/libraries/Adafruit_Circuit_Playground/Adafruit_Circuit_Playground.h:20:0,
from /tmp/arduino-1.8.12/libraries/Adafruit_Circuit_Playground/Adafruit_CircuitPlayground.cpp:30:
/home/pi/.arduino15/packages/arduino/hardware/samd/1.8.6/cores/arduino/Arduino.h:124:0: warning: “digitalPinToInterrupt” redefined
#define digitalPinToInterrupt(P) ( P )

In file included from /home/pi/.arduino15/packages/arduino/hardware/samd/1.8.6/cores/arduino/delay.h:23:0,
from /home/pi/.arduino15/packages/arduino/hardware/samd/1.8.6/cores/arduino/Arduino.h:81,
from /tmp/arduino-1.8.12/libraries/Adafruit_Circuit_Playground/Adafruit_Circuit_Playground.h:20,
from /tmp/arduino-1.8.12/libraries/Adafruit_Circuit_Playground/Adafruit_CircuitPlayground.cpp:30:
/home/pi/.arduino15/packages/arduino/hardware/samd/1.8.6/variants/circuitplay/variant.h:57:0: note: this is the location of the previous definition
#define digitalPinToInterrupt(P) (g_APinDescription[P].ulExtInt)

In file included from /tmp/arduino-1.8.12/libraries/Adafruit_Circuit_Playground/utility/Adafruit_CPlay_NeoPixel.h:39:0,
from /tmp/arduino-1.8.12/libraries/Adafruit_Circuit_Playground/utility/Adafruit_CPlay_NeoPixel.cpp:37:
/home/pi/.arduino15/packages/arduino/hardware/samd/1.8.6/cores/arduino/Arduino.h:124:0: warning: “digitalPinToInterrupt” redefined
#define digitalPinToInterrupt(P) ( P )

In file included from /home/pi/.arduino15/packages/arduino/hardware/samd/1.8.6/cores/arduino/delay.h:23:0,
from /home/pi/.arduino15/packages/arduino/hardware/samd/1.8.6/cores/arduino/Arduino.h:81,
from /tmp/arduino-1.8.12/libraries/Adafruit_Circuit_Playground/utility/Adafruit_CPlay_NeoPixel.h:39,
from /tmp/arduino-1.8.12/libraries/Adafruit_Circuit_Playground/utility/Adafruit_CPlay_NeoPixel.cpp:37:
/home/pi/.arduino15/packages/arduino/hardware/samd/1.8.6/variants/circuitplay/variant.h:57:0: note: this is the location of the previous definition
#define digitalPinToInterrupt(P) (g_APinDescription[P].ulExtInt)

In file included from /tmp/arduino-1.8.12/libraries/Adafruit_Circuit_Playground/utility/Adafruit_CPlay_LIS3DH.cpp:24:0:
/home/pi/.arduino15/packages/arduino/hardware/samd/1.8.6/cores/arduino/Arduino.h:124:0: warning: “digitalPinToInterrupt” redefined
#define digitalPinToInterrupt(P) ( P )

In file included from /home/pi/.arduino15/packages/arduino/hardware/samd/1.8.6/cores/arduino/USB/USBCore.cpp:21:0:
/home/pi/.arduino15/packages/arduino/hardware/samd/1.8.6/cores/arduino/Arduino.h:124:0: warning: “digitalPinToInterrupt” redefined
#define digitalPinToInterrupt(P) ( P )

In file included from /home/pi/.arduino15/packages/arduino/hardware/samd/1.8.6/cores/arduino/delay.h:23:0,
from /home/pi/.arduino15/packages/arduino/hardware/samd/1.8.6/cores/arduino/Arduino.h:81,
from /home/pi/.arduino15/packages/arduino/hardware/samd/1.8.6/cores/arduino/USB/USBCore.cpp:21:
/home/pi/.arduino15/packages/arduino/hardware/samd/1.8.6/variants/circuitplay/variant.h:57:0: note: this is the location of the previous definition
#define digitalPinToInterrupt(P) (g_APinDescription[P].ulExtInt)

/home/pi/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-ar: error while loading shared libraries: libfl.so.2: cannot open shared object file: No such file or directory
exit status 127
Error compiling for board Adafruit Circuit Playground Express.

I believe you can fix this error by running the following command from the terminal on your Raspberry Pi:

sudo apt install libfl2

Reference:

It worked thanks!

You're welcome. I'm glad to hear it's working now. Enjoy!
Per