测试项目中Makefile中的Qtcreator错误
Qtcreator Error in Makefile in a test project
我第一次尝试 运行 qtcreator。
我已经使用以下基本代码创建了一个空的 Qt 项目:
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
return app.exec();
}
但是当我点击 "run" 时,Makefile 报错。
16:31:38: Running steps for project test...
16:31:38: Configuration unchanged, skipping qmake step.
16:31:38: Starting: "/usr/bin/make"
Makefile:100: target 'all' doesn't match the target pattern
Makefile:106: *** target pattern contains no '%'. Stop.
16:31:38: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project test (kit: Desktop)
When executing step
"Make" 16:31:38: Elapsed time: 00:00.
第 100 行是:
all: ../%{JS:\ Util.asciify(build-test-Desktop-Debug)}/Makefile $(TARGET)
而 106 是:
../%{JS:\ Util.asciify(build-test-Desktop-Debug)}/Makefile: ../test/test.pro /usr/share/qt4/mkspecs/linux-g++-64/qmake.conf /usr/share/qt4/mkspecs/common/unix.conf \
Qtcreator 在我的测试项目旁边创建了一个目录,名为:%{JS: Util.asciify("build-test-Desktop-Debug")}
我该如何解决这个错误?
我将project/general/build目录更改为与项目路径相同的目录,它在我的qt Creator5.2、macOs 10.15.4
中有效
这是qmake限制导致的间接错误。创建新项目时,向导默认将您的构建目录设置为home/user/project/build
,这是不支持的。将构建目录设置为 home/user/build
可以解决 QtCreator 5.2 上的这个问题。
我第一次尝试 运行 qtcreator。
我已经使用以下基本代码创建了一个空的 Qt 项目:
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
return app.exec();
}
但是当我点击 "run" 时,Makefile 报错。
16:31:38: Running steps for project test...
16:31:38: Configuration unchanged, skipping qmake step.
16:31:38: Starting: "/usr/bin/make"
Makefile:100: target 'all' doesn't match the target pattern
Makefile:106: *** target pattern contains no '%'. Stop.
16:31:38: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project test (kit: Desktop)
When executing step
"Make" 16:31:38: Elapsed time: 00:00.
第 100 行是:
all: ../%{JS:\ Util.asciify(build-test-Desktop-Debug)}/Makefile $(TARGET)
而 106 是:
../%{JS:\ Util.asciify(build-test-Desktop-Debug)}/Makefile: ../test/test.pro /usr/share/qt4/mkspecs/linux-g++-64/qmake.conf /usr/share/qt4/mkspecs/common/unix.conf \
Qtcreator 在我的测试项目旁边创建了一个目录,名为:%{JS: Util.asciify("build-test-Desktop-Debug")}
我该如何解决这个错误?
我将project/general/build目录更改为与项目路径相同的目录,它在我的qt Creator5.2、macOs 10.15.4
中有效这是qmake限制导致的间接错误。创建新项目时,向导默认将您的构建目录设置为home/user/project/build
,这是不支持的。将构建目录设置为 home/user/build
可以解决 QtCreator 5.2 上的这个问题。