Results 1 to 5 of 5

Thread: namespace problem

  1. #1
    Join Date
    Jan 2006
    Location
    Maui, Hawaii
    Posts
    120
    Thanks
    65
    Thanked 4 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default namespace problem

    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.

  2. #2
    Join Date
    Jun 2006
    Location
    San Jose, CA
    Posts
    53
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: namespace problem

    I guess you need to edit your .pro file and add
    CONFIG += network
    to get network related stuff.

  3. The following user says thank you to larry104 for this useful post:

    mhoover (11th July 2006)

  4. #3
    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: namespace problem

    Quote Originally Posted by larry104
    CONFIG += network
    It should be "QT += network".

  5. The following user says thank you to jacek for this useful post:

    mhoover (11th July 2006)

  6. #4
    Join Date
    Jun 2006
    Location
    San Jose, CA
    Posts
    53
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: namespace problem

    Yes, sorry I was pasting the wrong line.

  7. #5
    Join Date
    Jan 2006
    Location
    Maui, Hawaii
    Posts
    120
    Thanks
    65
    Thanked 4 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: namespace problem

    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...treceiver.html

Similar Threads

  1. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 12:54
  2. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  3. Problem with bitBlt
    By yellowmat in forum Newbie
    Replies: 1
    Last Post: 5th April 2006, 14:08
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  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
  •  
Qt is a trademark of The Qt Company.