Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Add QDeclarativeView widget to MainWindows.ui cause link error
QtWS25 Last Chance

Add QDeclarativeView widget to MainWindows.ui cause link error

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 3 Posters 4.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kathy
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      Did you add this to you .pro file?

      @
      QT += declarative
      @

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kathy
        wrote on last edited by
        #3

        Yes. Thank you.

        1 Reply Last reply
        0
        • D Offline
          D Offline
          DenisKormalev
          wrote on last edited by
          #4

          kathy, "yes" as "yes, I've added it" or as "yes, it solved the problem"?

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kathy
            wrote on last edited by
            #5

            yes, it solved the problem

            1 Reply Last reply
            0
            • D Offline
              D Offline
              DenisKormalev
              wrote on last edited by
              #6

              then please don't forget to mark thread as [solved].

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved