[SOLVED] QT 4.8.3 Mac OS X (Mountain Lion) QHttp/QNetworkAccessManager
-
Hi,
I've just installed Qt 4.8.3 on my Mac and I have small problem with including QHttp or QNetworkAccessManager.
I can see QNetworkAccessManager in /Library/Frameworks/ but when I am trying do add it in header file IDE is giving me error :/Can anyone tell me how to install corectly QT on Mac?
Previously installer was installing IDE in a specific folder and everything was working fine, but now I am little confuesd, especialy that I am not keen on in Qt (not yet ;) ).Maciej.
-
#include <QHttp>
.../myjson.h:5: błąd:QHttp: No such file or directory#include <QNetworkAccessManager>
.../myjson.h:5: błąd:QNetworkAccessManager: No such file or directorybut file is located in:
/Library/Frameworks/QtNetwork.framework/Versions/4/Headers/qnetworkaccessmanager.h -
I found that if I do in that way:
@
#ifndef MYJSON_H
#define MYJSON_H#include <QObject>
//#include "QNetworkAccessManager"#include "/Library/Frameworks/QtNetwork.framework/Versions/4/Headers/qhttp.h"
class myJson
{
public:
myJson();public slots:
int getJsonFromUrl(QString aJsonURL);};
#endif // MYJSON_H
@then project is going to compile, but I don't think that is the correct solution :(
-
Glad you were able to figure it out! Apparently nobody had anything helpful to offer. I was at a loss, so I didn't comment. Hopefully your solution will help anyone else with a similar problem. Thanks for posting it.
Be sure and edit your initial post to add [Solved] to the title.
-
I know that topic is solved but I've found better and more correct way to solve the case ;-)
In file *.pro we need to add line:
@QT += network@and then in our module/header file we can use:
@ #include <QNetworkAccessManager>
#include <QUrl>@In this way compilation is correct and we are not given strange errors ;-)