PIO compiler says no such file or directory when file clearly exists

I finally found the solution in another thread: PIO library doesn't see header files in project's include folder - #6 by geoffreyottoy

To summarize: all files in src and include folders are not global. The linker cannot know of the existence of these files, even if intellisense (which is not the same as the linker which is not the same to the compiler) knows its reference.

To solve this problem add the following line to the platform.ini file.
build_flags = -I include

This will make the content of the include folder visible