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);
};
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 ;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With