I have a real strange & frustrating experience here:
While trying to iron out another problem, i suddenly got a lot of undefined references to a number of variables and structures i had declared (say myvar is one of them) as extern in my gui-protos.h file.
I deleted them there and added them to gui.c where i have my main() function.
The problem did not disappear. I tried at different places with regard to my includes to no avail. I then just put the declaration as well in gui-protos.h
and gui.c and now got understandable errors pointing me to the last redefined variable.
I also had an error of 'myvar undeclared' in main where myvar was the first one used in main (myvar = 0; )
Stripping them from gui.c brings me back to the previous situation: lots of undefined references.
What can i have done to get into this situation ? How can i detect it??
Sat, 2012-03-10 17:28
#1
gcc myvar undeclared & undefined references to myvar /// usage of extern vatiables