A class pointing to a clas ho has the first class inside a vector...
Well, I just downloaded the Game Tutorials OpenGL code for loading 3DS files, and I was trying to make the structures into a class, So I placed the Render function inside these classes.
The problem is: I have the C3DModel class and the C3DObject class. Now, the C3DObject class has a pointer to the C3DModel class that is holding his textures, but the C3DModel class has an array of C3DObjects. So, when I try to compile it, if says that on the C3DObject the C3DModel pointer isn''t declared on this scope, but it is right bellow him. But if I place it on top, then he will say that the C3DObject wasn''t declared yet. Any ideas how to work this out???
Thanks.
There is a difference between declaration and definition.
Add a declaration (class C3DModel;) before C3DObject''s definition - or the reverse.
[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]
Add a declaration (class C3DModel;) before C3DObject''s definition - or the reverse.
[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement