|
-
Nov 10th, 2004, 09:51 AM
#1
Forward declaration.
Do anyone know this topic in and out?
I have a school assignment, and it is getting pretty big. And I keep getting errors like Object all ready defind in ***.obj. I guess this is because that more then one .h file is including the same class. And even if I use Include guards I am getting this error. I have heard that forward declarations can help me get rid of these problems. Anyone know how to use them properly. Like now the poblem is that I have a main file, that includes a terrain.h file, and the terrain.cpp file aslo includes the terrain.h file, and then the terrain.h file includes the file.h.
Then I am getting the error:
error LNK2005: "public: __thiscall cFile::cFile(void)" (??0cFile@@QAE@XZ) already defined in main.obj
and so on for the rest of the functions in the cFile class (in the file.h)
Last edited by NoteMe; Nov 11th, 2004 at 12:34 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|