Results 1 to 4 of 4

Thread: No such file or directory only QTcpServer and QTcpSocket

  1. #1
    Join Date
    Jun 2007
    Posts
    28
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default No such file or directory only QTcpServer and QTcpSocket

    Hi,

    I start to test a socket application (tripserver from "C++ GUI PROGRAMMING WITH QT4"), but, when I type make command I have this message:

    massimiliano@nowire:~/lavoro/cvs/openshowvarqt4prove/simpleserver$ make
    /usr/bin/uic-qt4 simpleserverwindow.ui -o ui_simpleserverwindow.h
    g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -I. -o main.o main.cpp
    In file included from main.cpp:2:
    simpleserver.h:2:22: error: QTcpServer: No such file or directory
    simpleserver.h:3:22: error: QTcpSocket: No such file or directory

    In the .h file I have:

    Qt Code:
    1. #include <QTcpServer>
    2. #include <QTcpSocket>
    To copy to clipboard, switch view to plain text mode 

    I have no problem whit the other Q class include.

    nowire

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: No such file or directory only QTcpServer and QTcpSocket

    From docs:
    Applications that use Qt's networking classes need to be configured to be built against the QtNetwork module. The following declaration in a qmake project file ensures that an application is compiled and linked appropriately:

    QT += network
    J-P Nurmi

  3. #3
    Join Date
    Jun 2007
    Posts
    28
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: No such file or directory only QTcpServer and QTcpSocket

    OK jpn, now work fine.

    I use kdevelop, is possible to set this configuration in a project options?

    thanks,
    nowire

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: No such file or directory only QTcpServer and QTcpSocket

    Quote Originally Posted by nowire75 View Post
    I use kdevelop, is possible to set this configuration in a project options?
    I believe with KDevelop 3.4 it should be possible.
    J-P Nurmi

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

    nowire75 (5th July 2007)

Similar Threads

  1. Replies: 6
    Last Post: 8th January 2007, 11:24

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.