Qt creator cannot find, QTcpServer and QTcpSocket

1.9k views Asked by At

Eventhough, I put 'network' in .pro file,

My Qt creator cannot find QTcpSocket and QTcpServer.

What should I do?

I remove the Qtcreator and redownloaded already but it also did not work.

My Linux version is Ubuntu 14.04 LTS

and I downloaded QT Creator by linux commands.

sudo apt-get install qtcreator

I even do the linus updates because I worried that I missed something.

sudo get-apt update sudo get-apt upgrade

Why Qtcreator cannot perceive QTcpServer and QTcpSocket headers?

--------------*.pro -----------------------------------

QT       += core gui network

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = server11
TEMPLATE = app


SOURCES += main.cpp\
        mainwindow.cpp

HEADERS  += mainwindow.h

FORMS    += mainwindow.ui

-------------------mainwindow.h--------------------------------------

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTcpSocket>
#include <QTcpServer>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private:
    Ui::MainWindow *ui;
};

#endif // MAINWINDOW_H

1

There are 1 answers

0
Abhishek Nagekar On

Did you install the complete framework? Or just the IDE?

Try downloading the Qt offline installer and downloading the framework through it. Download and install it from here.

Qt Open Source

Instructions for Ubuntu