[英]Qt. No rule to make target in the '.pro', needed by 'Makefile'. Stop
So, I wrote a code for a Pythagoras calculator app in Qt creator, but when I try to compile it I get the following error message:因此,我在 Qt creator 中为毕达哥拉斯计算器应用程序编写了代码,但是当我尝试编译它时,我收到以下错误消息:
:-1: error: No rule to make target '../CalculadoradePitágoras16062022/CalculadoradePitágoras16062022.pro', needed by 'Makefile'. Stop.
My pro.我的亲。 file looks like this:
文件如下所示:
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = CalculadoradePitágoras16062022
TEMPLATE = app
SOURCES += main.cpp\
widget.cpp
HEADERS += widget.h
FORMS += widget.ui
RESOURCES += \
Resources.qrc
RC_ICONS = IconoP070720222.ico
By the way, I´ve tried to turn off the shadowbuild checkbox but I get another error:顺便说一句,我试图关闭 shadowbuild 复选框,但我得到另一个错误:
:-1: error: No rule to make target '../../../../../../../Qt/Qt5.2.0/5.2.0/mingw48_32/mkspecs/modules/qt_lib_designercomponents_private.pri', needed by 'Makefile'. Stop.
What should I do in this case?在这种情况下我该怎么办?
I would personally use cmake for any new Qt projects launched, going forward.我个人会在未来推出的任何新 Qt 项目中使用 cmake。 This is because Qt has chosen cmake to be the buildsystem for Qt.
这是因为 Qt 选择了 cmake 作为 Qt 的构建系统。
Whilst in essence, you can use something else, it is still reasonable to remain consistent with that.虽然从本质上讲,您可以使用其他东西,但保持一致仍然是合理的。
CMakeLists.txt CMakeLists.txt
set(CMAKE_AUTORCC ON)
find_package(Qt5 5.15 REQUIRED COMPONENTS Core Widgets)
add_executable(QtResource Resources.qrc main.cpp widget.cpp)
target_link_libraries(QtResource Qt::Widgets)
main.cpp主文件
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
// Do something with the resource.
return app.exec();
}
application.qrc应用程序.qrc
<RCC>
<qresource prefix="/" >
<file>IconoP070720222.ico</file>
</qresource>
</RCC>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.