Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

undefined reference to `vtable for MainWindow' error

Tags:

linux

qt

qwt

hi every one i am working a in qt and qwt but in my program i am getting these error

undefined reference to `vtable for MainWindow' error: collect2: ld returned 1 exit status

i didnt get it what is the meaning of these error can some one explain it as apparently i have no error in my code

thanks

like image 432
tariq Avatar asked Oct 11 '22 11:10

tariq


1 Answers

You're not linking to everything you should. You need to run moc on your .cpp files, and add e.g. #include "moc_myfile.cpp" to the end of myfile.cpp

Alternatively, you have declared a virtual function (destructor perhaps) without defining it.

like image 77
Erik Avatar answered Oct 15 '22 11:10

Erik