reference

Discussion in 'C++' started by Michael Sgier, Aug 16, 2006.

  1. Hi
    why that error?
    Main.cpp:(.text+0xd0f): undefined reference to
    `CJoysticksManager::CJoysticksManager()'

    the constructor is in Joysticks.h:
    class CJoysticksManager : public CStreamObject
    {
    public:
    CJoysticksManager();



    in main.cpp:
    globals->joymgr = new CJoysticksManager();

    and in globals.h:
    CJoysticksManager *joymgr;

    headers are included:
    #include "../Include/FlyLegacy.h"
    #include "../Include/Joysticks.h"
    #include "../Include/Globals.h"



    --
    Linuxgames: http://shop.sgier.com
     
    Michael Sgier, Aug 16, 2006
    #1
    1. Advertising

  2. Michael Sgier wrote:
    > why that error?
    > Main.cpp:(.text+0xd0f): undefined reference to
    > `CJoysticksManager::CJoysticksManager()'
    >
    > the constructor is in Joysticks.h:
    > class CJoysticksManager : public CStreamObject
    > {
    > public:
    > CJoysticksManager();
    >
    >
    >
    > in main.cpp:
    > globals->joymgr = new CJoysticksManager();
    >
    > and in globals.h:
    > CJoysticksManager *joymgr;
    >
    > headers are included:
    > #include "../Include/FlyLegacy.h"
    > #include "../Include/Joysticks.h"
    > #include "../Include/Globals.h"


    You declared the default constructor, you used it in the "new"
    expression. Where is it *defined*?

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
     
    Victor Bazarov, Aug 16, 2006
    #2
    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. Darren
    Replies:
    0
    Views:
    521
    Darren
    Oct 11, 2004
  2. Dude
    Replies:
    0
    Views:
    382
  3. ce
    Replies:
    1
    Views:
    3,023
  4. sam pal
    Replies:
    3
    Views:
    594
    E. Robert Tisdale
    Jul 16, 2003
  5. Craig Nicol
    Replies:
    2
    Views:
    482
    Craig Nicol
    May 10, 2004
Loading...

Share This Page