gpt4 book ai didi

c++ - 测试项目中Makefile中的Qtcreator错误

转载 作者:行者123 更新时间:2023-11-28 04:51:48 25 4
gpt4 key购买 nike

我是第一次尝试运行 qtcreator。

我已经使用以下基本代码创建了一个空的 Qt 项目:

#include <QApplication>

int main(int argc, char *argv[])
{
QApplication app(argc, argv);

return app.exec();
}

但是当我点击“运行”时,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")}

我该如何解决这个错误?

最佳答案

这是qmake的限制导致的间接错误。创建新项目时,向导默认将您的构建目录设置为home/user/project/build,这是不支持的。将构建目录设置为 home/user/build 可以解决 QtCreator 5.2 上的这个问题。

关于c++ - 测试项目中Makefile中的Qtcreator错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48063909/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com