Add QDeclarativeView widget to MainWindows.ui cause link error
-
wrote on 6 May 2011, 14:35 last edited by
I use Qt Creator (2.1 and 2.2 RC) to create a Qt GUI application by using create project wizard. I have Qt 4.7.3 library installed for Windows XP. After new project created, I build it and successful. But if I drag a QDeclarativeView widget to MainWindows.ui and try to build again and got link errors like:
MainWindow.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QDeclarativeView::QDeclarativeView(class QWidget *)" (_imp??0QDeclarativeView@@QAE@PAVQWidget@@@Z) referenced in function "public: void __thiscall Ui_MainWindow::setupUi(class QMainWindow *)" (?setupUi@Ui_MainWindow@@QAEXPAVQMainWindow@@@Z)
What is the problem?
-
wrote on 6 May 2011, 16:40 last edited by
Did you add this to you .pro file?
@
QT += declarative
@ -
wrote on 6 May 2011, 21:38 last edited by
Yes. Thank you.
-
wrote on 6 May 2011, 21:59 last edited by
kathy, "yes" as "yes, I've added it" or as "yes, it solved the problem"?
-
wrote on 6 May 2011, 22:47 last edited by
yes, it solved the problem
-
wrote on 7 May 2011, 08:00 last edited by
then please don't forget to mark thread as [solved].
1/6