Seems a tad weird! A #include
in a source file in src
should be able to find a header file that lives in include
. (Without needing to add relative paths.)
Aha!
It’s building the library, not the main.cpp
file, my mistake.
Headers for libraries need to go in the library directory I have found. This keeps them self-contained. The exception to this are the compiler supplied headers.
So,
sensors.cpp
andsensors.h
are inlib/sensors
- Any other headers specific to the library, are in the same place.
- In the library sources, you would
#include
the list of required headers explicitly. (<stdint.h>
and “Arduino.h”). - Headers for the main app file(s) go in
src
orinclude
.
HTH
Cheers,
Norm.