main.c
myHeaders.hCode:#include "myHeaders.h" int main(void) { printf("Hello World!", struct1.myInt); }
myFuncs.cCode:extern struct myStruct; struct myStruct{ int myInt; };
Compiler complains, in main.c, that "struct1 is undeclared (first use in this function)."Code:#include "myHeaders.h" struct myStruct struct1;
This makes no sense. Ofcourse its declared. Its declared in the header file. The header file is in turn included in main.
Whats wrong?