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);
};
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well, the error message is pretty self-explanatory,
foois 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
foois something else rather than a class definition. Changing the name will most likely solve your issue. Another way would be to put your definition offoointo another namespace. And anyway I would not recommend you to name something asfooin a real project, no matter how small it is 😉