Sign in to follow this  

header troubles

Recommended Posts

I am creating game engine and basing it on engine from 'OpenGL game programming' ( 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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this