[RESOLVED] error C2143: syntax error : missing ';' before '*'
Hey guys, I was trying to write a character controller but when I went to add my pointer to my character I get error C2143: syntax error : missing ';' before '*'
I've looked at all my classes involved but I don't see any errors and Visual Studio doesn't report any other specific errors. Is there any way of finding the source of this type of error?
Re: error C2143: syntax error : missing ';' before '*'
Yes there is....post the offending line of code....and several before and after so we can help you fix your problem...
Re: error C2143: syntax error : missing ';' before '*'
ok -
<code>
void updateCameraGoal(Real deltaYaw, Real deltaPitch, Real deltaZoom)
{
mCameraPivot->yaw(Degree(deltaYaw), Node::TS_WORLD);
// bound the pitch
if (!(mPivotPitch + deltaPitch > 25 && deltaPitch > 0) &&
!(mPivotPitch + deltaPitch < -60 && deltaPitch < 0))
{
mCameraPivot->pitch(Degree(deltaPitch), Node::TS_LOCAL);
mPivotPitch += deltaPitch;
}
Real dist = mCameraGoal->_getDerivedPosition().distance(mCameraPivot->_getDerivedPosition());
Real distChange = deltaZoom * dist;
// bound the zoom
if (!(dist + distChange < 8 && distChange < 0) &&
!(dist + distChange > 25 && distChange > 0))
{
mCameraGoal->translate(0, 0, distChange, Node::TS_LOCAL);
}
}
protected:
CharacterOgre * mChar;
</code>
Why dont my code tags work? Offending line is CharacterOgre * mChar;
Re: error C2143: syntax error : missing ';' before '*'
Quote:
Originally Posted by
drwbns
Why dont my code tags work?
After 121 posts, you don't realize that code tags use square brackets?
Quote:
Offending line is CharacterOgre * mChar;
So how can you use a type that the compiler doesn't know anything about? What is a "CharacterOgre"? I don't see that definition anywhere, and neither does the compiler.
When you post code that doesn't compile, you should post all the code that you're trying to compile. If I took what you posted, I would get a boatload of other errors.
Regards,
Paul McKenzie
Re: error C2143: syntax error : missing ';' before '*'
Sorry, I don't post here very often and a lot of other sites use <code> for tags. But I solved the problem, I had 2 headers including each other