Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Linkage Error for ... everything?
Forum Updated to NodeBB v4.3 + New Features

Linkage Error for ... everything?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 2.3k Views 1 Watching
  • 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.
  • Y Offline
    Y Offline
    ykmd
    wrote on last edited by
    #1

    This is my school project.
    I was able to use it with 5.0.1 before.
    And now I would like to transfer the files and make them compatible with 5.0.2...

    This is my .pro file:
    @QT += core gui widgets multimedia

    SOURCES +=
    mainwindow.cpp
    main.cpp

    HEADERS +=
    mainwindow.h

    LIBS += -lQtCore -lQtGui -lQtWidgets

    target.path = "C:/Users/D-Yau/Documents/Qt/QTune"
    INSTALLS += target@

    which gives me this kind of errors:
    @mainwindow.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QWidget::QWidget(class QWidget *,class QFlags<enum Qt::WindowType>)" (_imp??0QWidget@@QEAA@PEAV0@V?$QFlags@W4WindowType@Qt@@@@@Z) referenced in function "private: void __cdecl MainWindow::createLayoutWidgets(void)" (?createLayoutWidgets@MainWindow@@AEAAXXZ)
    @

    The weird thing is the number of error will never be the same.
    Would there be any other potential problems?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tomma
      wrote on last edited by
      #2

      @QT += core gui widgets multimedia@

      Will automatically link against right Qt libs. So there is no need for:
      @LIBS += -lQtCore -lQtGui -lQtWidgets@

      Remove them just to make sure it won't try to link against wrong version of Qt.

      Also make sure to clean your project so there won't be any old compiled objects.

      1 Reply Last reply
      0
      • Y Offline
        Y Offline
        ykmd
        wrote on last edited by
        #3

        I tried both versions but same thing happens.
        So I randomly added as much as I saw in the .pro
        Those are what I saw so far, but it doesnt work.

        [quote author="Tomma" date="1366351720"]@QT += core gui widgets multimedia@

        Will automatically link against right Qt libs. So there is no need for:
        @LIBS += -lQtCore -lQtGui -lQtWidgets@

        Remove them just to make sure it won't try to link against wrong version of Qt.

        Also make sure to clean your project so there won't be any old compiled objects.[/quote]

        1 Reply Last reply
        0
        • U Offline
          U Offline
          utcenter
          wrote on last edited by
          #4

          Did you try cleaning your build, running qmake and rebuilding?

          1 Reply Last reply
          0
          • Y Offline
            Y Offline
            ykmd
            wrote on last edited by
            #5

            Yes. I have tried to compile it on VS2012 directly and QtCreator itself...
            They have the same issues so far.

            [quote author="utcenter" date="1366390631"]Did you try cleaning your build, running qmake and rebuilding?[/quote]

            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