Aah yes I remember again. You’re doing everything right, PlatformIO has pretty sure a bug there that currently prevents it from detecting the inclusion by not seeing that a define exists which lights up certain code triggering the inclusion…
The exact same was also reported at Failure building Adafruit Sensor Calibration Library - can't find Adafruit_SPIFlash.h
A bug report was opened but it was said that it isn’t a bug after all, to which I disagree, but haven’t further had the time to investigate and prove the opposite.
The workaround is valid exactly as in the referenced post. We make sure PIO sees the section
as activated by defining EXTERNAL_FLASH_DEVICES
to the same value is the board header file itself would
so adding
build_flags = -DEXTERNAL_FLASH_DEVICES=GD25Q16C
to the platformio.ini
will also solve your problem here.