Hello all,
I’m trying to organise my codebase to support separating abstract virtual interfaces from MCU specific implementations.
I want the following arrangement:
|--lib
| |
| |--Interfaces
| | |-iLed.h
| |
| |--MCU
| | |--Feather32u4
| | | |--src
| | | | |-Led.h
| | | | |-Led.cpp
| | |--Nodemcuv2
| | | |--src
| | | | |-Led.h
| | | | |-Led.cpp
|--src
| |- main.cpp
In e.g. Feather32u4\src\Led.h
#include <iLed.h>
class LED : public iLED {}
In main.cpp
#include <MCU/Feather32u4/src/Led.h>
Attempts:
[1] This (and combinations of it):
#include </MCU/Feather32u4/src/Led.h>
doesn’t work. It produces:
src/main.cpp:1:38: fatal error: /MCU/Feather32u4/src/Led.h: No such file or directory
[2] Although this fails to specify which Led.h
to include:
#include <Led.h>
it apparently finds lib/MCU/Feather32u4/src/Led.h
, but produces:
lib/MCU/Feather32u4/src/Led.h:2:18: fatal error: iLed.h: No such file or directory
Question: What spells do I have to cast through platformio.ini
and various library.json
files to get the compiler to find the header files? Is there some other way of achieving this outcome?
Many thanks.