gpt4 book ai didi

c++ - QTcpServer错误C1083, "no such file or directory"

转载 作者:行者123 更新时间:2023-11-28 02:30:15 26 4
gpt4 key购买 nike

我正在使用 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

最佳答案

如果 .pro 文件有任何变化(如果添加 Qt += 网络),您需要重新运行 qmake

Build->Run qmake.

关于c++ - QTcpServer错误C1083, "no such file or directory",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29204694/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com