Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in inclusion of <QNetworkAccessManager>,<QNetworkReply> in cpp file of a BB10 app development

I am currently working on BB10 app development and trying for some HTTP connection demo app.

But in the cpp file is giving a ? in front of inclusion statement #include <QNetworkAccessManager> saying Unresolved Inclusion : <QNetworkAccessManager>.

Anyone please help me.

Thanks in advance.

like image 354
Sunil Targe Avatar asked Nov 27 '22 09:11

Sunil Targe


1 Answers

QNetworkAccessManager comes with the QtNetwork module. You could do this: #include <QtNetwork/QNetworkAccessManager>, which should compile. However, it will not link, you need to link to QtNetwork. To achieve this, you should tell QMake that you're using QtNetwork. Add this to your .pro project file: QT += network.

This has two effects: first, the compiler will look for include files in the QtNetwork subdirectory too (so you don't need to include <QtNetwork/QNetworkAccessManager>, <QNetworkAccessManager> will work just fine). Secondly, the linker will link to QtNetwork too. So everything will work just fine.

You can read more about using Qt modules here.

like image 164
Marc Plano-Lesay Avatar answered Dec 21 '22 08:12

Marc Plano-Lesay