Same as per Pico `build_flags = -I pgmspace.h` Doesn't affect build - "pgmspace.h: No such file or directory" – the library is written for the Arduino-Pico core, not ArduinoCore-mbed.
Alternatively use the Arduino-Pico per Arduino-Pico (Earlephilhower) support, PicoProbe Debugging by maxgerhardt · Pull Request #36 · platformio/platform-raspberrypi · GitHub.