-
September 29th, 2012, 06:51 PM
#1
[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?
Last edited by drwbns; October 3rd, 2012 at 08:33 AM.
-
September 29th, 2012, 08:48 PM
#2
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...
Jim
ATP BE400 CE500 (C550B-SPW) CE560XL MU300 CFI CFII
"The speed of non working code is irrelevant"... Of course that is just my opinion, I could be wrong.
"Nothing in the world can take the place of persistence. Talent will not; nothing is more common than unsuccessful men with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination are omnipotent. The slogan 'press on' has solved and always will solve the problems of the human race."...Calvin Coolidge 30th President of the USA.
-
September 29th, 2012, 09:03 PM
#3
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;
-
September 30th, 2012, 02:33 AM
#4
Re: error C2143: syntax error : missing ';' before '*'
Originally Posted by drwbns
Why dont my code tags work?
After 121 posts, you don't realize that code tags use square brackets?
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
-
October 3rd, 2012, 08:32 AM
#5
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|