PDA

View Full Version : QT first interface - statement cannot resolve address



dacrawler
22nd January 2011, 12:25
Hey,
I am probably blind, because I typed this tutorial like 10 times now and I get the error:
main.cpp: In function 'int main(int, char**)':
main.cpp:7 error: statement cannot resolve address of overloaded function
make: ***[main.o] Error 1

Should be easy to solve for one of you. I am pretty good at C++, but totally new to QT and its ui. Thx.

tbscope
22nd January 2011, 12:52
Oops:

w.show();

stampede
22nd January 2011, 12:59
Taschenrechner w;
w.show;
Did you mean

w.show();
? :)

And bout that:

class Taschenrechner : public QMainWindow, public Ui::MainWindow
You may consider using composition instead of inheritance. Now if you change the ui, you'll have to recompile all files that include "Tashenrechner.h"
If you forward declare the ui class in "Taschenrechner.h" and include "ui_Taschenrechner.h" in .cpp you can avoid this.

--------------------

edit: looks like I'm too slow :(

dacrawler
22nd January 2011, 14:08
thanks... i do not know how i couldnt get this.