Take the 2-minute tour ×

Can anyone please tell why this error? I have included everything ( all header, sources and form class) in my .pro file

Error message:

debug/moc_calculatorform.o:moc_calculatorform.cpp:(.rdata$_ZTV14CalculatorForm[v‌​table for CalculatorForm]+0xb0):

undefined reference to `CalculatorForm::changeEvent(QEvent*)'
collect2: ld returned 1 exit
status mingw32-make.exe[1]:

[debug\calculatorform.exe] Error 1 mingw32-make.exe:
[debug] Error 2 13:02:27: The process "C:\QtSDK\mingw\bin\mingw32-make.exe" exited with code 2. Error while building project calculatorform (target: Qt Simulator) When executing build step 'Make'

share|improve this question

closed as not a real question by BЈовић, Nawaz, David Schwartz, Mat, JoseK Mar 27 '12 at 11:54


Did it give you anymore information? Currently we know failed, that's it. –  cmannett85 Mar 27 '12 at 7:30
I know why this error. Line number 0x007 causes this error. –  Nawaz Mar 27 '12 at 7:36
and what is Line number 0x007 and how to solve it? –  Raven Mar 27 '12 at 7:39
@Raven - They are just kidding. You don't tell us enough to see where the problem is. So one guess is that could be on line 7, or line 6, or any other line. We just don't know. –  Bo Persson Mar 27 '12 at 7:45
@Default: Actually, that is pretty much obvious. If the error is at line number 0x007, then to fix it, you may have to look all the lines from 0x000 to 0x007 which includes 0x006 by Default.;-) –  Nawaz Mar 27 '12 at 7:46
show 3 more comments

1 Answer

up vote 0 down vote accepted

undefined reference to CalculatorForm::changeEvent(QEvent*)

There's your answer, the linker can't find the definition of this method - you have probably forgotten to implement it.

share|improve this answer
no. i have implemented that too –  Raven Mar 27 '12 at 7:45
It's coming from Qt's moc output though, have you done a clean rebuild since implementing it? –  cmannett85 Mar 27 '12 at 7:51
ok. yeah i missed that in one file. Thankx :) –  Raven Mar 27 '12 at 7:51
but now it says error: cannot call member function 'virtual void QWidget::changeEvent(QEvent*)' without object –  Raven Mar 27 '12 at 7:52
How are you calling it from where that error is produced? –  cmannett85 Mar 27 '12 at 7:53
add comment
