0

So I'm facing a problem with my C++ Project, I get an error

"1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall RegisterLoginHandler::RegisterLoginHandler(void)" (??0RegisterLoginHandler@@QAE@XZ) referenced in function "void _cdecl main::`dynamic initializer for 'registerLoginHandler''(void)" (??_EregisterLoginHandler@main@@YAXXZ)"

main.obj error line RegisterLoginHandler *registerLoginHandler = new RegisterLoginHandler();

I'm thinking that it maybe because of the this

#include <map>
#include "handler.h"

class RegisterLoginHandler :
    public Handler
{
private:
    std::map<int, int> *loginAttempts;
public:
    RegisterLoginHandler(void);
    ~RegisterLoginHandler(void);
    virtual bool OnCommand(MyPlayer *player, std::string cmd, std::vector<std::string> args, GameUtility *gameUtility);
    virtual void CheckForHacks();
    virtual void Load(GameUtility* gameUtility);
    bool AccountExists(std::string name);
    bool OnPlayerConnect(int playerid);
    bool OnDialogResponse(int playerid, int dialogid, int response, int listitem, char* inputtext, GameUtility *gameUtility);
};

Thank you for your help!

Martin J.
  • 5,028
  • 4
  • 24
  • 41

1 Answers1

1

The error message is clear enough: the linker can not find the definition of the default constructor

RegisterLoginHandler(void);

that is declared in the class definition.

Vlad from Moscow
  • 301,070
  • 26
  • 186
  • 335
  • I'm just gonna go out and say that I'm pretty much stupid at this thing and to kindly ask to try and fix this thing. Thank you sir. – user3132286 Mar 25 '14 at 16:22
  • 2
    @user3132286 The code you showed contains only the class definition. But it does not contain member function definitions. possibly you did not include the corresponding module in the project that contains these definitions – Vlad from Moscow Mar 25 '14 at 16:26