【问题标题】:Qtcreator Error in Makefile in a test project测试项目中 Makefile 中的 Qtcreator 错误
【发布时间】:2018-06-12 07:59:04
【问题描述】:

我正在尝试第一次运行 qtcreator。

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

#include <QApplication>

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

    return app.exec();
}

但是当我点击“运行”时,Makefile 报错了。

16:31:38:项目测试的运行步骤...

16:31:38:配置未更改,跳过 qmake 步骤。

16:31:38:开始:“/usr/bin/make”

Makefile:100: 目标“全部”与目标模式不匹配

Makefile:106: *** 目标模式不包含“%”。停下来。

16:31:38:进程“/usr/bin/make”以代码 2 退出。

构建/部署项目测试时出错(套件:桌面)

执行步骤时

“制作”16:31:38:经过时间: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")}

我该如何解决这个错误?

【问题讨论】:

标签: c++ qt makefile qt-creator


【解决方案1】:

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

【讨论】:

    【解决方案2】:

    我把project/general/build目录改成和项目的路径一样,在我的qt Creator5.2,macOs 10.15.4下工作

    【讨论】:

      猜你喜欢
      • 2011-09-08
      • 1970-01-01
      • 1970-01-01
      • 2021-12-02
      • 1970-01-01
      • 2022-08-19
      • 1970-01-01
      • 2012-01-29
      • 2011-06-20
      相关资源
      最近更新 更多