Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/127.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 编译期间未找到QDialog_C++_Qt_Qmake - Fatal编程技术网

C++ 编译期间未找到QDialog

C++ 编译期间未找到QDialog,c++,qt,qmake,C++,Qt,Qmake,我请求您了解QT 您知道为什么在编译过程中moc文件无法从QT中找到include吗 我目前在Qt项目中有这个问题,错误是 “moc_设置Dialog.cpp:9:在moc_设置Dialog.cpp:9中包含的文件中: SettingsDialog.h:12:错误:“未找到QDialog”文件” 这是我的专业文件: #------------------------------------------------- # # Project created by QtCreator 2018-12

我请求您了解QT

您知道为什么在编译过程中moc文件无法从QT中找到include吗

我目前在Qt项目中有这个问题,错误是

“moc_设置Dialog.cpp:9:在moc_设置Dialog.cpp:9中包含的文件中: SettingsDialog.h:12:错误:“未找到QDialog”文件”

这是我的专业文件:

#-------------------------------------------------
#
# Project created by QtCreator 2018-12-04T14:58:35
#
#-------------------------------------------------

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = cashRegister
TEMPLATE = app

message($${INCLUDEPATH})


# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

CONFIG += c++11


SOURCES += \
        main.cpp \
        cashRegister.cpp \
    sources/settings.cpp \
    sources/settingsBuilder.cpp \
    sources/parseConfFile.cpp \
    sources/SupplyList.cpp \
    sources/Item.cpp \
    sources/SettingsDialog.cpp \
    sources/TpeNetwork.cpp \
    sources/ManagerNetwork.cpp \
    sources/BillNetwork.cpp \
    sources/PaymentServerNetwork.cpp \
    sources/NetworkFactory.cpp \
    sources/Customer.cpp \
    sources/Cart.cpp

HEADERS += \
        cashRegister.h \
    includes/settings.h \
    includes/settingsBuilder.h \
    includes/parseConfFile.h \
    includes/SupplyList.h \
    includes/Item.h \
    includes/Mybutton.h \
    includes/SettingsDialog.h \
    includes/TpeNetwork.h \
    includes/ManagerNetwork.h \
    includes/BillNetwork.h \
    includes/PaymentServerNetwork.h \
    includes/NetworkFactory.h \
    includes/NetworkCode.h \
    includes/networkabstract.h \
    includes/networkinterface.hpp \
    includes/Customer.h \
    includes/Cart.h

FORMS += \
        cashRegister.ui \
    SettingsDialog.ui

macx {
    _BOOST_PATH = /usr/local/Cellar/boost/1.68.0
    INCLUDEPATH += "$${_BOOST_PATH}/include/"
    LIBS += -L$${_BOOST_PATH}/lib -lboost_regex
}

unix:!macx {
    LIBS += -L"/usr/lib/x86_64-linux-gnu" -lboost_regex

    INCLUDEPATH += /usr/include/boost
    DEPENDPATH += /usr/include/boost
    DEFINES += QT_NO_VERSION_TAGGING

}

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

RESOURCES += \
    config.qrc
Qt版本:5.12.0
MacOS 10.14和Ubuntu

编译命令行时是什么样子的?和SettingsDialog.h代码?请至少发布SettingsDialog.h
的标题部分,如果没有设置Dialog\u h#定义SettingsDialog\u h#包含#包含#包含命名空间Ui{class SettingsDialog};类设置Dialog:public QDialog{Q_OBJECT public:/***@brief settings dialog*@param parent*/explicit settings dialog(QWidget*parent=nullptr)
编译器的消息是:
在moc_settings dialog.cpp:9中包含的文件中:../../cashrister/includes/settings dialog.h:12:10:致命错误:“未找到QDialog”文件include