Results 1 to 2 of 2

Thread: quint16 problem !!!

  1. #1
    Join Date
    Jan 2006
    Posts
    185
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default quint16 problem !!!

    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 ?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: quint16 problem !!!

    Try adding #include <QtGlobal>

Similar Threads

  1. Problem in using QHttp with QTimer
    By Ferdous in forum Newbie
    Replies: 2
    Last Post: 6th September 2008, 12:48
  2. Weird problem: multithread QT app kills my linux
    By Ishark in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2008, 09:12
  3. Steps in solving a programming problem?
    By triperzonak in forum General Programming
    Replies: 8
    Last Post: 5th August 2008, 08:47
  4. quint16 compiling problem
    By MarkoSan in forum Qt Programming
    Replies: 5
    Last Post: 30th November 2007, 18:08
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.