PDA

View Full Version : No such file or directory only QTcpServer and QTcpSocket



nowire75
28th June 2007, 21:44
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:


#include <QTcpServer>
#include <QTcpSocket>

I have no problem whit the other Q class include.

nowire

jpn
28th June 2007, 21:55
From docs (http://doc.trolltech.com/4.3/qtnetwork#configuring-the-build-process):


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

nowire75
28th June 2007, 22:11
OK jpn, now work fine.

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

thanks,
nowire

jpn
29th June 2007, 08:32
I use kdevelop, is possible to set this configuration in a project options?
I believe with KDevelop 3.4 (http://www.kdevelop.org/index.html?filename=3.4/features.html) it should be possible.