Jump to content
  • Advertisement
Sign in to follow this  
Rozik

Compiler Error

This topic is 4808 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi all i have a compiler error and i cant figure out what the problem is this is my class in UIControl.h class UIControl{ protected: UIControl* m_NextSibling; public: UIControl* GetNextSibling(void){return m_NextSibling;} }; Well the class has lots more member variables and functions but thats the line i get the error in the error is: error C2059 Syntaxerror:'constant' and i have no clue what the problem is would be so great if someone could help me Thx a lot in advance Rozik

Share this post


Link to post
Share on other sites
Advertisement
I can't see any problems with this code. Often times the error is in the line preceding the line where the error is indicated (if you want to know why you must dive into compiler building). Perhaps still post the full code, using source tags instead of code tags.

Greetz,

Illco

Share this post


Link to post
Share on other sites
There is nothing wrong with the code you posted. The problem is probably being caused by something earlier in the file.

edit - too slow, again.

Share this post


Link to post
Share on other sites
As has been mentioned there is nothing wrong with the code you posted, however from this:


error C2059 Syntaxerror:'constant'



It looks like you are using 'constant' as a keyword, maybe when you meant to say const? Or maybe thats the name of a variable you have somewhere?

Alan

Share this post


Link to post
Share on other sites
I would say that you're using a constant (like 1, 3, 9, 12, or some #define or const) for something you shouldn't be. Post the entire code, and we'll be able to tell you more.

Share this post


Link to post
Share on other sites
Thx all!

I couldnt post it cause there was just so much code:)

Since every file compiled fine for itself i played around with the includes and i guess it was the order of includes in the main file cause when i changed the order there it sudently worked:)

Thx a lot anyways!

Share this post


Link to post
Share on other sites
If you need to post a lot of code to these forums, stick it between [source] tags. That puts your six pages in a nice small window, complete with syntax highlighting and scroll bars if the text is bigger than the window.

For example,

[source]
class UIControl{
protected:
UIControl* m_NextSibling;

public:
UIControl* GetNextSibling(void){return m_NextSibling;}
};
[/source]

becomes


class UIControl{
protected:
UIControl* m_NextSibling;

public:
UIControl* GetNextSibling(void){return m_NextSibling;}
};




It's usually a good idea to post whole files, because errors are farily often not where you might expect them to be. The same goes for posting the whole compile log.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!