Ok, say I have a declaration.h file which inside of it has the following:
extern int lineno;
typedef struct treeNode
{
int lineno;
some other stuffs here
}
and I have another file which is test.c, which wants to use the lineno variable on that declaration.h file. I already include declaration.h on top of the header of test.c, however it still can't find lineno. It gives me an error of:
undefined reference to `lineno'
So what should I do so that I can use the lineno variable? Thanks