#include <QtNetwork>
Environment Linux 32bit Ubuntu, SDK updated to Sept 29th version.
The include file cannot be loaded by g++, yet there appears to be several copies of this include file, in different folders, but none where from where the SDK is looking. Is there a problem with my installation or is there an error in the SDK? I am using 32bit linux on a Ubuntu system.
The pro file is freshly created.
Error message No such file or directory
9 replies
Did you add this module in your .pro file? You should have line like this:
- QT += network
Hi I’m trying the same to include the QtNetwork but getting the error.
(QtCreator version 2.6.1) based on Qt 5.0
#————————————————————————-
#
- Project created by QtCreator 2013-01-28T14:13:44
# #————————————————————————-
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
greaterThan(QT_MAJOR_VERSION, 4): QT += network
I have also tried removing above line and
QT += network without the greaterThan but still getting same error
main.h:7: error: C1083: Cannot open include file: ‘QtNetwork’: No such file or directory
regards
Sikander Mirza
sorry but couldn’t get it, I used the #include <QtNetwork> didn’t add .h to any include
secondly more interestingly I created a new project and it worked fine with it without any error, and thirdly I made the release build for the same and there the include was fine.
then again clean build the debug and the error still exists.
In .pro file use:
- QT += network
//as Thomas Zander already said no greaterThan is needed
Than run qmake (this is needed after you add modules in your project) and than build your project and it should work.
And +1 to Andre’s suggestion to include the headers only for classes you use, instead of the whole module.
You must log in to post a reply. Not a member yet? Register here!






