Results 1 to 32 of 32

Thread: Forward declaration.

Threaded View

  1. #1

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Resolved 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
  •  



Click Here to Expand Forum to Full Width