Does anybody know what I’ve done wrong in order to include the header file? The header file declares all functions that are built in multiple c files. The picture below briefly describes the structure of the src directory:
The file structure itself is perfectly fine. When you have .c
files interacting with .cpp
files though, you have to make sure that the header files are using the proper extern "C"
declarations (here) to declare those fucntions that are written in C. If you don’t do so, you will encounter undefined reference to [..]
errors.
But as you didn’t post any actual error message at all, this is “looking into the crystal ball”.
And of course, in .c
, you are unable to use classes, thus certain functionality from the e.g. Arduino framework like the Serial
class for UART or Wire
class for I2C is inaccessible.