Skip to main content

Posts

Showing posts with the label Qt

How to fix Qt Error when adding new form

I was trying to add new form UI class form to the Qt and since I'm a newbie ( actually started today) with C++ Qt framwork at this time i got stuck when I tried to add Push button to open new Class Form. it showed this damn error several times. mainwindow.obj:-1: error: LNK2019: unresolved external symbol "public: __cdecl DialogDemo::DialogDemo(class QWidget *)" (??0DialogDemo@@QEAA@PEAVQWidget@@@Z) referenced in function "private: void __cdecl MainWindow::on_btn_cancel_clicked(void)" (?on_btn_cancel_clicked@MainWindow@@AEAAXXZ) Rebuilding and cleaning the project not worked since I've tried several ways to display that new GUI form. Solution was simple here i quote stackoverflow answer. Solution Right click on project > Clean Right click on project > Run qmake Right click on project > Build Run - worked first time Why it works The reason this worked is because Run qmake updates your Makefile. For some reason qt is not automatic...