Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt: QHostAddress: No such file or directory

Tags:

c++

qt

qt-creator

I'm new to Qt and when I try to run a program I get import error

fatal error: QHostAddress: No such file or directory

Caused by the import in main.cpp

#include <QCoreApplication>
#include <QHostAddress>

It seems that there is missing of QHostAddress.h while QCoreApplication.h is available

like image 901
TomNg Avatar asked Mar 07 '15 16:03

TomNg


1 Answers

Make sure you have something to the effect of :

QT += network

In your .pro file. Then run qmake again, and recompile.

like image 143
tux3 Avatar answered Nov 08 '22 18:11

tux3