Help me with QNetworkAccessManager. Err: undefined reference.
Im going to write a small program to download a link (QUrl) using QNetworkAccessManager. I found in QT help things are explain very simple. I do the same:
in Header file MainWindow.h:
Code:
QNetworkAccessManager *manager;
in MainWindow.cpp:
Code:
manager = new QNetworkAccessManager(this);
QNetworkReply
*rep
= manager
->get
(QNetworkRequest
(QUrl("http://www.google.com")));
But when I compile this prog, there are error messages: undefined reference to QNetworkAccessManager::QNetworkAccessManager(QObje ct*)
I cant understand why even though I read help file for ten times. Please help me. Thank you very mcuh.
Re: Help me with QNetworkAccessManager. Err: undefined reference.
You must have Qt+= network in .pro file
Re: Help me with QNetworkAccessManager. Err: undefined reference.
thank you very much. Its allright now.
Re: Help me with QNetworkAccessManager. Err: undefined reference.
For future reference, the necessary additions to the project file for any class are found on the page describing the module containing the class:
http://doc.qt.nokia.com/latest/qtnetwork.html