You are not logged in.

1

Wednesday, April 25th 2007, 8:30am

Simple QHttp compile problem but difficult to find

Hello guys.
I'm not new to programming only to QT but this problem i cannot fix.
I made a very simple program that does nothing. It only has one class (in a sperate file test.cpp and test .h) with a private member QHttp HttpClient.
My problem is that it compile this code in ms windowsxp qt 4.1 and in linux (mandrivalinux uptodate) qt 4.1 and 4.2 but the conpiler keeps giving the same error at the line

Source code

1
#include <QHttp>

It say it cannot find the file.
So i made a absolute path in the include statement like

Source code

1
#include </usr/local/Trolltech/Qt-4.2.3/include/QtNetwork/QHttp>

Now it compiles but it give other errors.

Quoted

/home/mantis/proj/test.h:7: undefined reference to `QHttp::~QHttp()'
/home/mantis/proj/test.h:7: undefined reference to `QHttp::~QHttp()'


I have been searching for this problem for 2 day and I can not understand what is the problem.
Do i need to include more files than <QHttp> When i include <QObject> or other stuff it does not give and problem but with <QHttp> gives error that I do not understand. I made my makefile with
qmake4 -project
qmake4
and whala i have a make file so that connot be the problem.
Cannot be syntax problem the code is so simple and I even rewrote it all.
The problem seems with QHttp
Does anyone also have this problem or know what it may be.
Many thanks for the help.

2

Wednesday, April 25th 2007, 5:17pm

RE: Simple QHttp compile problem but difficult to find

Nevermind I found the solution in another forum.
You need to put QT+=network in the pro file of your project.
Strange that I could not find it in the documentation