我正在使用 Qt 5.4.1 离线版本,我收到 QTcpServer 的文件未找到错误。我发布了我的 .pro 文件以表明我确实有 += 网络。如果您知道为什么我会收到此错误,请告诉我!谢谢!
#-------------------------------------------------
#
# Project created by QtCreator 2015-03-21T22:26:44
#
#-------------------------------------------------
QT += core
QT += network
QT -= gui
TARGET = MultiServer2
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp \
myserver.cpp \
mythread.cpp
HEADERS += \
myserver.h \
mythread.h
//开始下面的服务器头文件
#ifndef MYSERVER_H
#define MYSERVER_H
#include <QTcpServer> // <--- THIS IS WHAT IS NOT BEING FOUND
#include <QDebug>
#include "mythread.h"
class MyServer : public QTcpServer
{
Q_OBJECT
public:
explicit MyServer(QObject *parent = 0);
~MyServer();
void startServer();
signals:
public slots:
protected:
void incomingConnection(int socketDescriptor);
};
#endif // MYSERVER_H