mercredi 31 décembre 2014

QT, cannot instantiate an object in a window's constructor?


Vote count:

0




How do I create an instance of an object in the constructor for a window? I am generating three errors just by declaring a pointer, named objects, in 'window.h' and instantiating it in 'window.cpp:' 'Window::Window(...){...objects = new objectHandler(1)}'



window.obj:-1: error: LNK2019: unresolved external symbol "public: __thiscall objectHandler::objectHandler(int)" (??0objectHandler@@QAE@H@Z) referenced in function "public: __thiscall Window::Window(class QWidget *)" (??0Window@@QAE@PAVQWidget@@@Z)
(file not found)

window.obj:-1: error: LNK2019: unresolved external symbol "public: __thiscall objectHandler::~objectHandler(void)" (??1objectHandler@@QAE@XZ) referenced in function "public: void * __thiscall objectHandler::`scalar deleting destructor'(unsigned int)" (??_GobjectHandler@@QAEPAXI@Z)
(file not found)

debug\Phursik.exe:-1: error: LNK1120: 2 unresolved externals


I looked up the errors and apparently they have to do with the functions being declared but not defined by the class. I am sure; however, that all functions declared in 'objectHandler.h' are defined in 'objectHandler.cpp' and QT Creator even knows how to find one from the other. I am quite perplexed so thank you for your help in advance.



asked 31 secs ago







QT, cannot instantiate an object in a window's constructor?

Aucun commentaire:

Enregistrer un commentaire