Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redefinition of as a different kind of symbol

Tags:

c++

I'm creating a simple C++ header file in my xcode ios project but getting error "Redifinition of 'foo' as a different kind of symbol".

Here's the code

class foo 
{
    public:
         char* getLabel(char* params);
};
like image 905
nishantkyal Avatar asked Sep 13 '12 09:09

nishantkyal


1 Answers

Well, the error message is pretty self-explanatory, foo is already defined in the same namespace, and you are trying to re-define it.

The part "as a different kind of symbol" suggests that the existing foo is something else rather than a class definition. Changing the name will most likely solve your issue. Another way would be to put your definition of foo into another namespace. And anyway I would not recommend you to name something as foo in a real project, no matter how small it is ;)

like image 109
SingerOfTheFall Avatar answered Sep 20 '22 06:09

SingerOfTheFall