[Solved]undefined reference to `_imp___ZN21QNetworkAccessManagerC1EP7QObject'



  • Hi,
    I am new to QT technology,yesterday I was making some test app via QT.
    I have downloaded the QtFlickr app source code.
    I edited the HttpCommunicator class according to my requirement.
    But the main issue is when I am trying to build the project I am getting the following error.

    @debug/httpcommunicator.o: In function HttpCommunicator': D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:20: undefined reference to_imp___ZN21QNetworkAccessManagerC1EP7QObject'
    D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:26: undefined reference to _imp___ZN21QNetworkAccessManagerD1Ev' D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:20: undefined reference to_imp___ZN21QNetworkAccessManagerC1EP7QObject'
    D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:26: undefined reference to _imp___ZN21QNetworkAccessManagerD1Ev' D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:34: undefined reference to_imp___ZN21QNetworkAccessManagerC1EP7QObject'
    D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:37: undefined reference to _imp___ZN21QNetworkAccessManagerD1Ev' D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:34: undefined reference to_imp___ZN21QNetworkAccessManagerC1EP7QObject'
    D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:37: undefined reference to _imp___ZN21QNetworkAccessManagerD1Ev' debug/httpcommunicator.o: In function~HttpCommunicator':
    D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:48: undefined reference to _imp___ZN15QNetworkRequestD1Ev' D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:56: undefined reference to_imp___ZN21QNetworkAccessManagerD1Ev'
    D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:56: undefined reference to _imp___ZN21QNetworkAccessManagerD1Ev' D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:48: undefined reference to_imp___ZN15QNetworkRequestD1Ev'
    D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:56: undefined reference to _imp___ZN21QNetworkAccessManagerD1Ev' D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:56: undefined reference to_imp___ZN21QNetworkAccessManagerD1Ev'
    D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:48: undefined reference to _imp___ZN15QNetworkRequestD1Ev' D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:56: undefined reference to_imp___ZN21QNetworkAccessManagerD1Ev'
    D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:56: undefined reference to _imp___ZN21QNetworkAccessManagerD1Ev' debug/httpcommunicator.o:D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:115: undefined reference toimp___ZN15QNetworkRequest12setRawHeaderERK10QByteArrayS2'
    debug/httpcommunicator.o:D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:124: undefined reference to _imp___ZN15QNetworkRequestD1Ev' debug/httpcommunicator.o:D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:134: undefined reference to_imp___ZN15QNetworkRequestC1ERK4QUrl'
    debug/httpcommunicator.o:D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:135: undefined reference to _imp___ZN15QNetworkRequest6setUrlERK4QUrl' debug/httpcommunicator.o:D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:138: undefined reference to_imp___ZN21QNetworkAccessManager3getERK15QNetworkRequest'
    debug/httpcommunicator.o:D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:141: undefined reference to _imp___ZN21QNetworkAccessManager4postERK15QNetworkRequestP9QIODevice' debug/httpcommunicator.o:D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:144: undefined reference to_imp___ZN21QNetworkAccessManager14deleteResourceERK15QNetworkRequest'
    debug/httpcommunicator.o:D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:147: undefined reference to _imp___ZN21QNetworkAccessManager3putERK15QNetworkRequestP9QIODevice' debug/httpcommunicator.o:D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:150: undefined reference to_imp___ZN21QNetworkAccessManager4headERK15QNetworkRequest'
    debug/httpcommunicator.o:D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:159: undefined reference to _imp___ZNK13QNetworkReply5errorEv' debug/httpcommunicator.o:D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:182: undefined reference to_imp___ZNK13QNetworkReply9attributeEN15QNetworkRequest9AttributeE'
    debug/httpcommunicator.o:D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:185: undefined reference to _imp___ZNK13QNetworkReply9attributeEN15QNetworkRequest9AttributeE' debug/httpcommunicator.o:D:\QT\Workspace\QmlTest-build-simulator/../QmlTest/httpcommunicator.cpp:188: undefined reference to_imp___ZNK13QNetworkReply5errorEv'
    collect2: ld returned 1 exit status@@@

    Dont know what to do.Seeking helps from experts.
    Thanks in advance



  • Found a solution by my own
    Add QT+=network in your .pro file.



  • If all ok, please mark post title as [SOLVED] thanks


Log in to reply
 

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