Qt:没有规则来制作'ui_controlpanel.h'所需的目标'../controlpanel.ui'。停止

时间:2015-02-27 14:53:11

标签: c++ qt mingw qt-creator

我在Qt Creator上遇到了一个非常奇怪的问题。

:-1: error: No rule to make target '../controlpanel.ui', needed by 'ui_controlpanel.h'.  Stop.


mingw32-make[1]: *** No rule to make target '../controlpanel.ui', needed by 'ui_controlpanel.h'.  Stop.
mingw32-make: *** [debug] Error 2
makefile:34: recipe for target 'debug' failed
22:43:11: The process "C:\Qt\Qt5.4.0\Tools\mingw491_32\bin\mingw32-make.exe" exited with code 2.

此项目编制得很好。但现在我得到了编译错误。 我在Windows上使用Qt creator 5.4.0。

特别是,这个项目在Mac版的Qt Creator 5.4.0上没有任何错误编译。

出了什么问题?我该如何解决这个错误?

这是一个qmake文件。

QT       += core gui opengl network multimedia

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = LaserdockVisualizer
TEMPLATE = app
INCLUDEPATH += .

# dwarf-2 for profiling
#QMAKE_CXXFLAGS += -gdwarf-2

include(../../LaserdockCore/LaserdockCore.pri)
QMAKE_MAC_SDK = macosx10.10

SOURCES += \
    main.cpp \
    LaserdockVisualizer/LaserdockVisualizerDelegate.cpp \
    LaserdockVisualizer/Form/LaserdockMainWindow.cpp \
    ...
    LaserdockVisualizer/Visualizations/Visualizers/Appakabar/Test/ldAppakabarTestSoundEventUtilVisualizer.cpp \
    LaserdockVisualizer/Visualizations/Visualizers/Appakabar/Test/ldAppakabarTestSoundEventUtilVisualizerControlPanel.cpp

HEADERS += \
    LaserdockVisualizer/LaserdockVisualizerDelegate.h \
    LaserdockVisualizer/Form/LaserdockMainWindow.h \
    ...
    LaserdockVisualizer/Visualizations/Visualizers/Appakabar/Test/ldAppakabarTestSoundEventUtilVisualizer.h \
    LaserdockVisualizer/Visualizations/Visualizers/Appakabar/Test/ldAppakabarTestSoundEventUtilVisualizerControlPanel.h


FORMS += \
    LaserdockVisualizer/Form/LaserdockMainWindow.ui \
    LaserdockVisualizer/Form/ldVisualizerControlPanelEmpty.ui \
    LaserdockVisualizer/Visualizations/Visualizers/ld3dCubeVisualizerControlPanel.ui \
    LaserdockVisualizer/Visualizations/Visualizers/Test/ldTestControlVisualizerControlPanel.ui \
    LaserdockVisualizer/Visualizations/Visualizers/Feldspar/ldWalkerVisualizerControlPanel.ui \
    LaserdockVisualizer/Visualizations/Visualizers/Test/ldTestCircleVisualizerControlPanel.ui \
    LaserdockVisualizer/Visualizations/Visualizers/Feldspar/test/ldMusicReactorTestVisualizerControlPanel.ui \
    LaserdockVisualizer/Visualizations/Visualizers/Feldspar/test/ldFrameTestVisualizerControlPanel.ui \
    LaserdockVisualizer/Visualizations/Visualizers/Appakabar/Test/ldappakabartestsoundeventutilvisualizercontrolpanel.ui

2 个答案:

答案 0 :(得分:6)

我得到了解决方案。

在Qt Creator上,进入" Projects Tab",然后你可以看到" Shadow build"。取消选中并编译。错误消失了。

答案 1 :(得分:1)

如果您只定位一个平台,

covernal's answer可以正常工作。但是,如果您正在为多个平台(例如,桌面和Android)进行编译,则可以继续进行阴影构建。以下是我修复它的方法:

从Projects选项卡中找到项目的构建目录: enter image description here

转到该目录并删除您找到的所有内容。 Qt将简单地重新创建重建项目所需的所有文件。