PDA

View Full Version : QUdpSocket no such file or directory in QtCreator 2.0.1



bob2oneil
16th February 2011, 23:10
This is perhaps a newbie question, but I am adding UDP networking support to an application, and including the reference in the header file does not resolve. This is under Windows with Qt Creator 2.0.1 with the open source version of Qt. Does this indicate some specific path information is missing, I can find the source files, or is it possible this is a feature only associated with the commercial release of the product.


#include <QUdpSocket>

squidge
16th February 2011, 23:19
Did you try using:



#include <QtNetwork>


Instead?

stampede
16th February 2011, 23:25
Do you have

QT += network
in your .pro file ?

bob2oneil
17th February 2011, 14:27
I did try <QtNetwork> initially and it did not resolve. However, the 2nd suggestion modifying the .pro file did the trick. I was wondering if perhaps UpdSocket support was an non-supported build option for the open source release
as opposed to the commercial release.

More broadly, I did not anticipate having to manual modify the project file to get networking support. I am missing something in QtCreator, where a GUI setting would be used to set these "optional" Qt features?

Is there some URL describing all of the optional settings required?

stampede
17th February 2011, 15:39
Here (http://doc.qt.nokia.com/latest/qmake-project-files.html) you have description of .pro files in general, and this section (http://doc.qt.nokia.com/latest/qmake-project-files.html#declaring-qt-libraries) describes all modules you can add with QT +=