PDA

View Full Version : quint16 problem !!!



probine
22nd March 2006, 22:25
I am creating a simple application and I need to use quint16 for my port. The error is:

ch/Qt-4.1.1/include/QtNetwork -I/usr/local/Trolltech/Qt-4.1.1/include/QtGui -I/usr/local/Trolltech/Qt-4.1.1/include -I. -I. -I. -o moc_ServerGUI.o moc_ServerGUI.cpp
Server.h:15: error: ISO C++ forbids declaration of 'quint16' with no type
Server.h:15: error: expected ';' before '*' token
make: *** [moc_ServerGUI.o] Error 1

The code looks like this:

# ifndef SERVER_H
# define SERVER_H

class QTcpServer;
class QString;
class QHostAddress;


class Server
{
private:
QTcpServer* chat_server;
const QString* ip_address;
const QHostAddress* host_address;
quint16* port;

.
.
.
};

What is wrong ? How do I solve the error ? Why ?

jacek
22nd March 2006, 22:35
Try adding #include <QtGlobal>