Sign in to follow this  
unholymight

Can someone educate me on where the syntax error is in this code?

Recommended Posts

#include "Unit.h"

class VisualRenderer
{
public:
  
  VisualRenderer();
  ~VisualRenderer();
  
  void trackSingleUnit(const Unit& cUnit);
};

The last line, with the trackSingleUnit function, is highlighted and the error in Dev-C++ is: 13 C:\Documents and Settings\manjun\My Documents\c++\opengl\VisualRenderer.h expected `,' or `...' before '&' token and 13 C:\Documents and Settings\manjun\My Documents\c++\opengl\VisualRenderer.h ISO C++ forbids declaration of `Unit' with no type

Share this post


Link to post
Share on other sites
I found my problem.

It seems that I also used the same #ifndef guard from above around my VisualRenderer class--I forgot to change the copy-and-pasted #ifndef UNIT_H to #ifndef VISUALRENDERER_H.



Thanks so much for the help.

Share this post


Link to post
Share on other sites
Quote:
Original post by unholymight
I found my problem.

It seems that I also used the same #ifndef guard from above around my VisualRenderer class--I forgot to change the copy-and-pasted #ifndef UNIT_H to #ifndef VISUALRENDERER_H.
Been there, done exactly that! Very confusing the first time, but the good news is that once you've done it you'll solve it far quicker next time.
It's all part of the learning process...

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