I have a file structure as follows:
interface.h --> interface.c
|
|
effects.h --> effects.c
|
|
main
However, functions declared in effects.h are not accessible in main.
Code snippets :
main :
#include "interface.h"
#include "effects.h"
void setup() //Initialize all variables here
{
....
turnoff();
};
effects.h :
#ifndef EFFECTS
#define EFFECTS
void turnoff();
#endif
effects.c :
#include "interface.h"
#include "effects.h"
void turnoff()
{
....
};
interface.h :
#ifndef INTERFACE
#define INTERFACE
....
#endif
Error message : In function ``loop':undefined reference to ``turnoff()'
The error message doesnt make sense as loop function is empty !
*.cxxor*.cpprather than*.c?)Ccode correctly.