Linkage Error for ... everything?



  • 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?



  • @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.



  • 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]



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



  • 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]


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.