undefined reference

Discussion in 'C++' started by Michael Sgier, Nov 3, 2005.

  1. Hi
    I get the error:

    `Unload' undeclared (first use this function)

    but I did in main.cpp:

    CMD2Model *myModel = new CMD2Model;

    here ( also in main.cpp) I get the above error:

    void CleanUp()
    {
    myModel-->Unload();
    delete myModel;

    // free(groundTexture);
    }

    and have also included a header file with the class:

    class CMD2Model
    {
    ...

    public:

    CMD2Model(); // constructor
    ~CMD2Model(); // destructor

    ...

    // free memory of model
    int Unload();
    ...

    Uhmmm whereis the mistake :) Thanks and regards
    Michael
    --
    Log on at www.mame.dk for MAME Arkade Game Roms
    :wq
    Michael Sgier, Nov 3, 2005
    #1
    1. Advertising

  2. Michael Sgier

    Tim Love Guest

    Michael Sgier <> writes:

    > myModel-->Unload();

    Or myModel->Unload();
    ?
    Tim Love, Nov 3, 2005
    #2
    1. Advertising

  3. Michael Sgier wrote:
    >
    > Hi
    >
    > I get the error:
    >
    > `Unload' undeclared (first use this function)
    >
    > but I did in main.cpp:
    >
    > CMD2Model *myModel = new CMD2Model;
    >
    > here ( also in main.cpp) I get the above error:
    >
    > void CleanUp()
    >
    > {
    >
    > myModel-->Unload();
    >


    You probably just confused your compiler.
    That should read:

    myModel->Unload();

    The operator is -> not -->


    --
    Karl Heinz Buchegger
    Karl Heinz Buchegger, Nov 3, 2005
    #3
  4. Michael Sgier

    Zara Guest

    On Thu, 03 Nov 2005 10:20:24 +0100, Michael Sgier <>
    wrote:

    >Hi
    > I get the error:
    >
    >`Unload' undeclared (first use this function)
    >
    >but I did in main.cpp:
    >
    >CMD2Model *myModel = new CMD2Model;
    >
    >here ( also in main.cpp) I get the above error:
    >
    >void CleanUp()
    >{
    > myModel-->Unload();



    I suppose you mean myModel->Unload();


    > delete myModel;
    >
    >// free(groundTexture);
    >}
    >
    >and have also included a header file with the class:
    >
    >class CMD2Model
    >{
    >..
    >
    >public:
    >
    > CMD2Model(); // constructor
    > ~CMD2Model(); // destructor
    >
    >..
    >
    > // free memory of model
    > int Unload();
    >..
    >
    >Uhmmm whereis the mistake :) Thanks and regards
    >Michael


    You have declared but not defined Unload.
    You need something like

    int CMD2Model::Unload()
    {
    // do whatever is fit
    }

    -- Zara
    Zara, Nov 3, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Felipe
    Replies:
    3
    Views:
    444
    Felipe
    Jul 16, 2004
  2. Lu
    Replies:
    1
    Views:
    567
    Roel Schroeven
    Jul 10, 2003
  3. Mantorok Redgormor
    Replies:
    70
    Views:
    1,750
    Dan Pop
    Feb 17, 2004
  4. VK
    Replies:
    45
    Views:
    590
    Dr John Stockton
    Sep 12, 2006
  5. -Lost
    Replies:
    13
    Views:
    368
    Richard Cornford
    Jan 31, 2007
Loading...

Share This Page