Skip to main content

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

  1. Right click on project > Clean
  2. Right click on project > Run qmake
  3. Right click on project > Build
  4. Run - worked first time

Why it works

The reason this worked is because Run qmake updates your Makefile. For some reason qt is not automatically updating paths when you make changes to your project such as adding or removing files. Running qmake forces qt to update the paths for your project which enables it to find the mainwindow.obj file. You probably could just run qmake and your problem would be solved.


Comments

Popular posts from this blog

පොත් කියවීමයි මමයි

පොතක් කියවන්න. වැඩි වයසක් නැති උනාට ඒ දවස් වල ආසම වැඩේ තමයි පොතක් කියවන එක. ගෙදර පරිසරය කොහොමෙන් හැදුනද දන්නේ නැති උනත් පුංචිම කාලේ ඉදල පොත් වලට තිබ්බේ පුදුම ආසාවක් . මම හිතන්නේ මට ඒ පුරුද්ද හැදෙන්න ඇත්තේ අක්ක නිසා වෙන්න ඕනි .  අම්මගේ තාත්තගේ පඩි දවසට අක්කටයි මටයි පොත් දෙකක් අනිවාර්යයි පොඩිම දවස් වල ඉදල. ඒ නැතත් පොතක් කියවල ඉවර වෙද්දී තව පොතක් අරන් දෙනවා කොහොම හරි කියවන්න.  ඒ නිසාම අපේ අම්ම මාවත් එකක්ගෙන ගිහින් පුස්තකාලෙට සම්බන්ද කළා . අනේ මන්ද මොකක් උනත් මට පුස්තකාලයට නම් පුරුදු වෙන්නම අමාරු උනා. අවුරුද්දක් විතර පුස්තකාලයට ගියත් ආයේ ගෙනාපු පොතක් ගෙනියන්න තියෙන කම්මැලි කමටම දෙතුන් පාරක් දඩ වැදුනම තවත් හිතට අමාරුයි . ඇයි ඉතින් එක පැත්තකින් මන් වැරද්දක් කළා කියන හැගීමයි අනිත් පැත්තෙන් අතේ තියෙන රුපියල් දහයක් විතර නැති වෙනවනේ .. හත් වලාමේ...  කොහොමෙන් හරි ඔය පොත් කියවිල්ලේ රුදාව නිසාම කොහොමෙන් හරි 5 , 6 වසර වගේ ඉද්දි අම්ම ගෙනාව හෙන පතාර පොතක් කැමති නම් කියවන්න කියල. හෙන අසාවෙන් ගත්තට මොකද අතට මෙලෝ සංසාරයක් තේරෙන්නේ නැ එකේ තියෙන. බාසාව නිකම් පාලි වගේ . වගේ නෙමෙයි පාලි තමයි . ක

Foxeprenuer at UCSC | Introduction to Firefox Student Ambassadors

Had privilege to attend another awesome event as Regional Ambassador Lead . "Foxepernuer 2016" organized by University of Colombo , School of Computing , UCSC Firefox Club - Sri Lanka . Introduction FSA Program - Sri Lanka  while I had chance to talk about Mozilla project , Firefox Student Ambassador program , contributions and benefits , had opportunity to meet great enthusiast people after the event.  And Future of developments & technologies , being a professional & maintain it Encouraging students bring innovative ideas happen , becoming entrepreneurs and really interesting topics we discussed by resource persons.   Shafraz Rahim and Malinda Prasad from Dialog Axiata IdeaMart , and Rashmika Nawaratne from 99X Techno logy has done those sessions in really interesting way !.  Rashmika Navaratne talk about maintain professionalism Shafraz Rahim on "Intern Entrepreneur" Malinda Prasad talk about "

Clash of Clan Meetup ? Call us Crazy

Yes ! , Call us craze or something. We Speedy-Sl  Clan of Clash of Clan Android had Meetup and yeah It was really really cool. Note : Clash of Clan is a Mobile Game with connect through the network . build your town center , clan wars between others . something like that if you don't know what COC already. So the day was 27th September and place was Grand Arcade , Kaduwela . went to kottawa with gang for taking the bus and unfortunately I missed the bus because it was the same day I brought OnePlus One and dealer came to the Homagama. I was bit late to the party while others already having fun -_-   Can you belive we printed T-Shirt for the clan ?  Unfortunatly we only had around 17 members from the clan to this meetup and hopefully I'm waiting for the next one.  Day was pretty much good , Thanks to Jasintha Peiris   and Dili Silva for organizing this meetup.  Author Note : It's not just about gaming or being childish wit