Jump to content
  • Advertisement
Sign in to follow this  

header troubles

This topic is 4850 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

I am creating game engine and basing it on engine from 'OpenGL game programming' (glbook.gamedev.net). I've created couple files, and they all compiled nicely. Now I created camera.h and object.h and i'm stuck. The error i get: error: variable or field 'OnDraw' declared void error: 'OnDraw' declared as a 'virtual' field error: expected ';' before '(' token and the function is here: // draws object for given camera location virtual void OnDraw(CCamera *camera) {} i noticed that it is prolly because the CCamera class from camera header is included after object header. i tried switching places. however, in camera.h, there are fields calling CObject class from object.h file, like: void LookAt(CObject *object); // camera rotates to look at object so it gives me same errors, just for different file :S i'm compiling it in g++. i am totally stumped. could anybody help me? will be very grateful, thanks in advance.

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!