Reputation: 119
I have an .h file with the following declarations:
typedef SetElement (*copySetElements)(SetElement);
typedef void (*freeSetElements)(SetElement);
typedef int (*compareSetElements)(SetElement, SetElement);
and another .h file with the following delarations:
SetElement copySetElements (SetElement element);
void freeSetElements (SetElement element);
int compareSetElements (SetElement element1, SetElement element2);
And I get the error: redeclared as different kind of symbol
in the second .h file (where I decalared the functions)
Once I change their names it dissapearrs. why?
Upvotes: 0
Views: 11256
Reputation: 33273
Typedefs share the same namespace as functions and global variables.
When you use the same name for two different things, the compiler wouldn't know which one you mean. So it gives an error instead.
Upvotes: 2