In Mac Terminal, type
xcrun --show-sdk-path
to get the XCode SDK path.
Add the path using the -I
option and additional /usr/include/**
to the build_flags option in platformio.ini
eg.
build_flags =
-I /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/**
found solution on some japanese blog