Can you post the whole main.cpp and error message (including line number) ?
Can you post the whole main.cpp and error message (including line number) ?
My main.cpp is
Qt Code:
#include <QtCore/QCoreApplication> #include <iostream> #include <conio.h> #include <stdio.h> #include <qnetwork.h> #include <qnetworkaccessmanager.h> int main(int argc, char *argv[]) { QNetworkAccessManager *manager = new QNetworkAccessManager(this); return a.exec(); }To copy to clipboard, switch view to plain text mode
and error messages are
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\..\..\ ..\..\include\qnetwork.h:16: error: expected constructor, destructor, or type conversion before '(' token
Ya then it compiles successfully....
but qnetwork.h is not hard coded file ... it is a predefined file.....
so how should I look for errors in this file..................?????
Firstly, if your program compiles without it then you don't need it, and don't need to correct errors in it.
Secondly, as advised earlier, qnetwork.h is not part of Qt. It has dependencies that you are missing before the include, specifically:
as in the Microsoft docs clearly states. If there are errors internal to that file (I strongly doubt it) then you need to address that with the author.To define the interface identifier, include the header file Initguid.h before Qnetwork.h, but after Dshow.h and other header files:
Note Make sure that Initguid.h is included only once in your project. Otherwise, you will receive linker errors for duplicate GUID values.Qt Code:
#include <dshow.h> #include <initguid.h> #include <qnetwork.h>To copy to clipboard, switch view to plain text mode
Thanks.. it solves my problem.... But after doing this I am getting one error ... here is
c:\qtsdk\mingw\bin\..\lib\gcc\mingw32\4.4.0\..\..\ ..\..\include\qnetwork.h:46: error: expected unqualified-id before '}' token
and I want to be clear about if qnetwork.h is a part of qt framework or not.......
<qnetwork.h> is not.. Qt has <QtNetwork>
Bookmarks