#ifndef _Face_
#define _Face_
#include <windows.h>
#include <GL\gl.h>
#include <GL\glu.h>
#include "Basics.h"
class Face : public Pickable
{
public:
Face(BaseModel* Base);
virtual int draw(int mode);
BaseModel *OverallObject;
vector <int> m_vIndices;
vector <int> m_nIndices;
vector <int> m_tIndices;
int m_mat;
int m_BuildIndex;
};
#endif
🔒 Locked
a strange error.
Advertisement
Original Post
Hi! I get this strange error: error C2143: syntax error : missing ';' before '' when i try to build my project. (VC6) it says the problem is within this code: can somebody help me solve it? thanx [smile]
thnx[smile]
and one last question... this time for real.
as you can see in my code , Face has a pointer to a class called "BaseModel".
in order to avoid cyclic inclusion, i added the declaration :
class BaseModel;
before the definition of Face.
but BaseModel is still not recognized...
WHY?
[i used this declaration style several years ago]
and one last question... this time for real.
as you can see in my code , Face has a pointer to a class called "BaseModel".
in order to avoid cyclic inclusion, i added the declaration :
class BaseModel;
before the definition of Face.
but BaseModel is still not recognized...
WHY?
[i used this declaration style several years ago]
The aforementioned use, i.e. using a forward declaration, is ok for the definition of a pointer-member (in a header file) but is not okay for use that requires the type definition. Therefore, in your CPP file, you need to include the header file anyway. So, continuing from my example:
Illco
// Header file as before// ...// CPP-file#include "BaseModel.h"Face::SomeMethod( void ){ baseModel->CallMe();}Illco
Not the source of your problems, but:
#ifndef _Face_
The identifier _Face_ is reserved for compiler and standard library implementors (identifiers starting with an underscore followed by a capital letter or containing a double underscore are reserved globally and identifiers starting with an underscore are reserved at file scope). Use it at your peril and don't be surprised when it gets tromped on in the future.
Enigma
#ifndef _Face_
The identifier _Face_ is reserved for compiler and standard library implementors (identifiers starting with an underscore followed by a capital letter or containing a double underscore are reserved globally and identifiers starting with an underscore are reserved at file scope). Use it at your peril and don't be surprised when it gets tromped on in the future.
Enigma
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement