Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
[SOLVED] QT 4.8.3 Mac OS X (Mountain Lion) QHttp/QNetworkAccessManager
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 ;) ).
What is the error that the IDE is giving you?
.../myjson.h:5: błąd:QHttp: No such file or directory
.../myjson.h:5: błąd:QNetworkAccessManager: No such file or directory
but file is located in:
I found that if I do in that way:
int getJsonFromUrl(QString aJsonURL);
#endif // MYJSON_H
then project is going to compile, but I don't think that is the correct solution :(
Does anyone has any idea?
I've installed Qt from pkg installer in order:
maybe this generates my problems??
Ok - I got it ;-)
I've just installed qt 1.2.1 and there in QTCreater intelli sense hints this:
and this is it ;-)
For me topic is solved ;)
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>
In this way compilation is correct and we are not given strange errors ;-)
Oh yes... that's obviously the cause. So simple it never occurred to me that you might not have done that. Sorry about that.
It's ok ;-) I'am newbie and I didn't do the most basic thing: RTFM ;)
I looked in example with http and the solution was so clear ad easy to find.