why are my classes unknown?

Started by
5 comments, last by SirKnight 17 years, 6 months ago
why is the line 'class gameGFX;' needed? Its declared in gameGFX which is included... But without that line it doesnt recognize gameGFX. Thanks #ifndef MAIN_H #define MAIN_H #include <hge.h> #include <hgesprite.h> #include <hgefont.h> #include <hgeparticle.h> #include <hgecolor.h> #include <fmod.h> #include <list> //non-game specific #include "def.h" #include "basic.h" #include "gameGFX.h" #include "gameGUI.h" //game specific #include "world.h" #include "actor.h" extern HGE * hge; class gameGFX; extern world www; extern gameGFX gfx; extern gameGUI gui; #endif
Advertisement
One thing that might cause this is if you have a cyclic inclusion.
It's all about the wheel.Never blindly trust technoligy.I love my internal organs.Real men don't shower.Quote:Original post by Toolmaker Quote:Original post by The C modest godHow is my improoved signature?It sucks, just like you.
Can we see gameGFX.cpp?
yeah that was it
thanks
An related issue:

I have a int2 class in basic.h
I have a unit class which need this class in unit.h
I have a main.h which holds all header-files so i include that one in other files.

Now:
In unit.h i include main.h so my unit can have int2 as members.
If i include unit.h in main.h (below basic.h) the int2 in unit.h is suddenly unknown!

why? the basic-header is above it?

Thanks
E
What is cyclic inclusion?
http://www.eventhelix.com/RealtimeMantra/HeaderFileIncludePatterns.htm

This topic is closed to new replies.

Advertisement