QtNetwork: No such file or directory 问题的解决

作者:fly 发布于:2014-3-14 16:30 分类:Linux

#include <QtNetWork>
程序在make时出现
server.h:7:21: error: QtNetwork: No such file or directory

后来几经周折,找到了解决办法
在当前目录下找到 .pro文件
在其中手工添加一行:

QT += network


以下是我这边完整的 .pro文件


#-------------------------------------------------
#
# Project created by QtCreator 2014-03-14T15:36:06
#
#-------------------------------------------------

QT       += core gui network
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = UMSserver
TEMPLATE = app


SOURCES += main.cpp\
        mainwindow.cpp \
    myserver.cpp \
    tcpclientsocket.cpp

HEADERS  += mainwindow.h \
    myserver.h \
    tcpclientsocket.h

FORMS    += mainwindow.ui

发表评论:

 
Powered by emlog sitemap