Error LNK2019: unresolved external symbol
-
You should include QFont:
@#include <QFont>@
In addition, in the .cpp file I cannot see when you create the "display" object:
@//display->setReadOnly(true);
/QFont displayFont = display->font();
displayFont.setPointSize(displayFont.pointSize() + 4);
display->setFont(displayFont);/
//Implement operation buttons@ -
Forget about the font and all of these stuff they are commented ,any way I edited the post and deleted them.
The creation of the Display object is in line 10 -
Well... I don't see the #include <QWidget> anywhere in your headers
-
[quote author="b1gsnak3" date="1360246401"]Well... I don't see the #include <QWidget> anywhere in your headers[/quote]
This won't be required as it's part of the inheritance chain.
-
I have tried to compile your program and it runs well for me. May be you could re-generate the Makefile and then clean project and re-compile again?
When I had these problems I had some methods declared but not implemented. Can ensure yourself that all the code posted is that you have?
We will solve this issue!
-
What usually works for me is to through away the entire build directory that Qt creates when debugging or running a program. This will remove all files generated by QMake (also your ui files). Then rebuild the program. Problem might be fixed then.
greetz -
Yes Thanks guys It did work after deleting the build folder, restart and rebuild :).
-
I often get such errors, 99.99% of the time it is solved by clicking "clean all" then "run qmake" then "rebuild all".
-
[quote author="utcenter" date="1360368863"]I often get such errors, 99.99% of the time it is solved by clicking "clean all" then "run qmake" then "rebuild all".[/quote]
The 0.01% remaining could be missing the name space in the .cpp file. For example:
You define a function in your class header (MyClass.h) :
@ int myFunction(int a, int b);@
But in the MyClass.cpp you miss the namespace:
@int myFunction(int a, int b){
// ...
}@instead of
@int Class::myFunction(int a, int b){
// ...
}@When calling that "myFunction" in your code, the error appears.
-
Worked for me on a project getting this error code :
[quote author="utcenter" date="1360368863"]I often get such errors, 99.99% of the time it is solved by clicking "clean all" then "run qmake" then "rebuild all".[/quote]Sir, you rock
-
Worked for me on a project getting this error code :
[quote author="utcenter" date="1360368863"]I often get such errors, 99.99% of the time it is solved by clicking "clean all" then "run qmake" then "rebuild all".[/quote]Sir, you rock