Your file, interface.c
will be compiled by the C compiler. The file, main.cpp
will be compiled by the C++ compiler. They do different things to function names. Because C++ allows you to override functions provided there are differences in the parameters, the C++ compiler mangles the function name to reflect the function name and parameters. The C compiler doesn’t.
At the moment, your RelayOn
function is sitting in an object file with exactly that name, RelayOn
. The C++ compiler has created a function call to something like RelayOnBool
which the linker cannot find, and the linker is the one complaining.
You should rename your interface.c
to interface.cpp
and then all will be well.
Note: Poetic Licence has been used in the above explanation, but that’s basically what’s gone wrong.
HTH
Cheers,
Norm.ot