PDA

View Full Version : namespace problem



mhoover
11th July 2006, 22:33
Hi,

I'm trying to use a QTcpSocket, but when I code this line:
#include <QTcpSocket>

I get this response:
QTcpSocket: No such file or directory

I would guess I'm not connecting to any Qt libs, but for some reason it seems to find <QtGui>, <QIODevice>, and <QMetaStuff> just fine.

I'm probably overlooking something obvious, but I can't seem to determine what it is.

larry104
11th July 2006, 22:43
I guess you need to edit your .pro file and add
CONFIG += network
to get network related stuff.

jacek
11th July 2006, 22:47
CONFIG += network
It should be "QT += network".

larry104
11th July 2006, 22:48
Yes, sorry I was pasting the wrong line.

mhoover
11th July 2006, 22:53
Great!

Thanks for the prompt reply!

It would help if the docs listed the project files in the examples:
http://doc.trolltech.com/4.1/network-broadcastreceiver.html