Get an error while linking a project using a sdk function on RP2040

I would like to use a function from RP2040 sdk in a platformio project.
The function is flash_range_erase() and is part of the sdk and is declared in flash.h.
My .cpp file has a line with #include <hardware/flash.h>
I do not get a compilation error but well at linking.
The error message at linking is:undefined reference to `flash_range_erase(unsigned long, unsigned int)’

Here my platformio.ini file:
[env:raspberry-mstrens]
platform = raspberrypi
board = pico
framework = arduino
upload_protocol = picotool

Is it possible to get access to all SDK function within the arduino framework???

It seems I can solve the issue using
extern “C” {
#include <hardware/flash.h>
};

instead of
#include <hardware/flash.h>