I have this code:
auto pLabel = CCLabelTTF::create("Test", "Arial", 24);
auto pLabel->setColor(ccc3(0,0,0));
And my Eclipse shows these markers on the second line:
Multiple markers at this line
- Invalid arguments ' Candidates are: void setColor(const cocos2d::_ccColor3B &) '
- Invalid arguments ' Candidates are: cocos2d::_ccColor3B ccc3(?, ?, ?) '
These are not real errors, I mean, I can build the project without problems so it has to be some kind of Eclipse-related mistake.
ccc3 is an inline function:
static inline ccColor3B
ccc3(const GLubyte r, const GLubyte g, const GLubyte b)
{
ccColor3B c = {r, g, b};
return c;
}
And if I rewrite the code in this way:
ccColor3B c3 = { 0, 0, 0 };
this->pLabel->setColor(c3);
The "error" is gone, so I guess it's related with the way Eclipse analyses the code, but I'm not able to find out what the exact problem is or how to solve it (or at least, how to make my Eclipse ignores it)
Any clues?
You can disable Syntax and Semantic Errors
in eclipse. Until you have setup all correct include paths you won't get anything right. And if still eclipse warns or shows errors then you can simply disable them.
Go to
Right Click Project -> C/C++ General -> Code Analysis -> Syntax and Semantic Errors
Uncheck the option.