Skip to main content
gamedev.net
🔒 Locked

Prototype

Started by Lord Maz 1 reply 300+ views
Original Post
Lord Maz
Lord Maz
Hey, I''ve got a pretty embarrasing problem. Here''s some pieces of the code:
  
...
class cTextureHandler;

class cOpenGL
{
        ...
	cTextureHandler TextureHandler;
        ...
};
							
class cTextureHandler
{
...	
};
  
This gives me a "error C2079: ''TextureHandler'' uses undefined class ''cTextureHandler''" - shouldn''t this work? btw, i know i can just move cTextureHandler a bit to make it work, but i don''t want to Thanks for any help! -Lord Maz-
-Lord Maz-
Way Walker
Way Walker
That doesn''t work because the compiler doesn''t know how big cTextureHandler is. If you change it from

cTextureHandler TextureHandler;

to

cTextureHandler *TextureHandler;

It''ll work, but then you need to change everything to deal with the fact that that''s a pointer and not the actual object.
Lord Maz
Lord Maz
Ah cool, thanks, I''ll try that!

-Lord Maz-
-Lord Maz-

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.