Redefinition as a different kind of character

I create a simple C ++ header file in my xcode ios project, but I get the error "Redifinition of foo" as another kind of character ".

Here is the code

class foo { public: char* getLabel(char* params); }; 
+7
source share
1 answer

Well, the error message is pretty clear, foo already defined in the same namespace, and you are trying to override it.

The β€œas a different kind of character” part assumes that the existing foo is something else, not a class definition. Changing the name is likely to solve your problem. Another way is to put your foo definition in a different namespace. And anyway, I would not recommend you call something like foo in a real project, no matter how small it is;)

+9
source

All Articles