static problem in c++
Quote:Original post by Trillobitvgc.h doesn't need to be included in both Entity.h and Entity.cpp (the latter include is redundant and can be removed).
Hmm.. About the includes, should I include vgc in both Entity.h and Entity.cpp?
I tried switching those includes, I get this now:
.\Entity.cpp(4) : error C2143: syntax error : missing ';' before 'Entity::collection'
vgc.h includes a lot of files, including the vgcvector.
Also, you might try making the following change to your code:
typedef typename Entity_Vector::iterator Entity_Iterator;
This will probably fix the missing ';' error you mentioned.
I added typename, like you said, and I get this error instead:
..\Entity.h(29) : error C2899: typename cannot be used outside a template declaration
Unfortunatly the other error seems to remain, second error is:
.\Entity.cpp(4) : error C2143: syntax error : missing ';' before 'Entity::collection'
And any comments on code style/design improvements is also very welcomed :)
..\Entity.h(29) : error C2899: typename cannot be used outside a template declaration
Unfortunatly the other error seems to remain, second error is:
.\Entity.cpp(4) : error C2143: syntax error : missing ';' before 'Entity::collection'
And any comments on code style/design improvements is also very welcomed :)
Quote:Original post by TrillobitSorry, that was my mistake - the typename keyword is not required in this case. As for the 'missing ;' error, it's not immediately clear to me where that's coming from...
I added typename, like you said, and I get this error instead:
..\Entity.h(29) : error C2899: typename cannot be used outside a template declaration
Unfortunatly the other error seems to remain, second error is:
.\Entity.cpp(4) : error C2143: syntax error : missing ';' before 'Entity::collection'
And any comments on code style/design improvements is also very welcomed :)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement