ちはや 2022-10-17 11:15 采纳率: 0%
浏览 297

Windows ninja 问题汇总 ninja: build stopped

Windows 下 QT6.3.2+vs2019 编译cmake代码时出现 ninja: build stopped报错:

D:\QTCode\Nodeeditor\external\Catch2\CMakeLists.txt:2: error: file DOWNLOAD HASH mismatch for file: [D:/QTCode/build-Nodeeditor-Desktop_Qt_6_3_2_MSVC2019_64bit-Debug/external/Catch2/single_include/catch2/catch.hpp] expected hash: [ea379c4a3cb5799027b1eb451163dff065a3d641aaba23bf4e24ee6b536bd9bc] actual hash: [e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855] status: [6;"Couldn't resolve host name"]

cmake一下后该问题解决。开始构建时出现以下错误:

D:\QTCode\Nodeeditor\test\src\TestDataModelRegistry.cpp:27: error: C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
D:\QTCode\Nodeeditor\test\src\TestDataModelRegistry.cpp:27: error: C2440: “初始化”: 无法从“initializer list”转换为“int”
D:\QTCode\Nodeeditor\test\src\TestDataModelRegistry.cpp(27): error C2440: “初始化”: 无法从“initializer list”转换为“int”
D:\QTCode\Nodeeditor\test\src\TestDataModelRegistry.cpp(27): note: 初始值设定项包含过多元素
D:\QTCode\Nodeeditor\test\src\TestDataModelRegistry.cpp:28: error: C2059: 语法错误:“{”
D:\QTCode\Nodeeditor\test\src\TestDataModelRegistry.cpp:28: error: C2143: 语法错误: 缺少“;”(在“{”的前面)
D:\QTCode\Nodeeditor\test\src\TestDataModelRegistry.cpp:28: error: C2447: “{”: 缺少函数标题(是否是老式的形式表?)
D:\QTCode\Nodeeditor\test\include\Stringify.hpp:13: error: C3856: “StringMaker”: 符号不是 模板 类
D:\QTCode\Nodeeditor\test\include\Stringify.hpp:13: error: C2146: 语法错误: 缺少“;”(在标识符“QPointF”的前面)
D:\QTCode\Nodeeditor\test\include\Stringify.hpp:13: error: C2913: 显式专用化;“Catch::StringMaker”不是类模板的专用化
D:\QTCode\Nodeeditor\test\include\Stringify.hpp:13: error: C2059: 语法错误:“>”
D:\QTCode\Nodeeditor\test\include\Stringify.hpp:14: error: C2143: 语法错误: 缺少“;”(在“{”的前面)
D:\QTCode\Nodeeditor\test\include\Stringify.hpp:14: error: C2447: “{”: 缺少函数标题(是否是老式的形式表?)
D:\QTCode\Nodeeditor\test\include\Stringify.hpp:30: error: C2913: 显式专用化;“Catch::StringMaker”不是类模板的专用化
D:\QTCode\Nodeeditor\test\src\TestFlowScene.cpp:27: error: C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
D:\QTCode\Nodeeditor\test\src\TestFlowScene.cpp:27: error: C2440: “初始化”: 无法从“initializer list”转换为“int”
D:\QTCode\Nodeeditor\test\src\TestFlowScene.cpp(27): error C2440: “初始化”: 无法从“initializer list”转换为“int”
D:\QTCode\Nodeeditor\test\src\TestFlowScene.cpp(27): note: 初始值设定项包含过多元素
D:\QTCode\Nodeeditor\test\src\TestFlowScene.cpp:28: error: C2059: 语法错误:“{”
D:\QTCode\Nodeeditor\test\src\TestFlowScene.cpp:28: error: C2143: 语法错误: 缺少“;”(在“{”的前面)
D:\QTCode\Nodeeditor\test\src\TestFlowScene.cpp:28: error: C2447: “{”: 缺少函数标题(是否是老式的形式表?)
D:\QTCode\Nodeeditor\test\src\TestFlowScene.cpp:198: error: C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
D:\QTCode\Nodeeditor\test\src\TestFlowScene.cpp:198: error: C2374: “TEST_CASE”: 重定义;多次初始化
D:\QTCode\Nodeeditor\test\src\TestFlowScene.cpp(198): error C2374: “TEST_CASE”: 重定义;多次初始化
D:\QTCode\Nodeeditor\test\src\TestFlowScene.cpp(27): note: 参见“TEST_CASE”的声明
D:\QTCode\Nodeeditor\test\src\TestFlowScene.cpp:199: error: C2059: 语法错误:“{”
D:\QTCode\Nodeeditor\test\src\TestFlowScene.cpp:199: error: C2143: 语法错误: 缺少“;”(在“{”的前面)
D:\QTCode\Nodeeditor\test\src\TestFlowScene.cpp:199: error: C2447: “{”: 缺少函数标题(是否是老式的形式表?)
D:\QTCode\Nodeeditor\test\src\TestNodeGraphicsObject.cpp:22: error: C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
D:\QTCode\Nodeeditor\test\src\TestNodeGraphicsObject.cpp:20: error: C2440: “初始化”: 无法从“initializer list”转换为“int”
D:\QTCode\Nodeeditor\test\src\TestNodeGraphicsObject.cpp(20): error C2440: “初始化”: 无法从“initializer list”转换为“int”
D:\QTCode\Nodeeditor\test\src\TestNodeGraphicsObject.cpp(20): note: 初始值设定项包含过多元素
D:\QTCode\Nodeeditor\test\src\TestNodeGraphicsObject.cpp:23: error: C2059: 语法错误:“{”
D:\QTCode\Nodeeditor\test\src\TestNodeGraphicsObject.cpp:23: error: C2143: 语法错误: 缺少“;”(在“{”的前面)
D:\QTCode\Nodeeditor\test\src\TestNodeGraphicsObject.cpp:23: error: C2447: “{”: 缺少函数标题(是否是老式的形式表?)
D:\QTCode\Nodeeditor\test\include\Stringify.hpp:13: error: C3856: “StringMaker”: 符号不是 模板 类
D:\QTCode\Nodeeditor\test\include\Stringify.hpp:13: error: C2146: 语法错误: 缺少“;”(在标识符“QPointF”的前面)
D:\QTCode\Nodeeditor\test\include\Stringify.hpp:13: error: C2913: 显式专用化;“Catch::StringMaker”不是类模板的专用化
D:\QTCode\Nodeeditor\test\include\Stringify.hpp:13: error: C2059: 语法错误:“>”
D:\QTCode\Nodeeditor\test\include\Stringify.hpp:14: error: C2143: 语法错误: 缺少“;”(在“{”的前面)
D:\QTCode\Nodeeditor\test\include\Stringify.hpp:14: error: C2447: “{”: 缺少函数标题(是否是老式的形式表?)
D:\QTCode\Nodeeditor\test\include\Stringify.hpp:30: error: C2913: 显式专用化;“Catch::StringMaker”不是类模板的专用化
D:\QTCode\Nodeeditor\test\src\TestDragging.cpp:26: error: C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
D:\QTCode\Nodeeditor\test\src\TestDragging.cpp:26: error: C2440: “初始化”: 无法从“initializer list”转换为“int”
D:\QTCode\Nodeeditor\test\src\TestDragging.cpp(26): error C2440: “初始化”: 无法从“initializer list”转换为“int”
D:\QTCode\Nodeeditor\test\src\TestDragging.cpp(26): note: 初始值设定项包含过多元素
D:\QTCode\Nodeeditor\test\src\TestDragging.cpp:27: error: C2059: 语法错误:“{”
D:\QTCode\Nodeeditor\test\src\TestDragging.cpp:27: error: C2143: 语法错误: 缺少“;”(在“{”的前面)
D:\QTCode\Nodeeditor\test\src\TestDragging.cpp:27: error: C2447: “{”: 缺少函数标题(是否是老式的形式表?)
:-1: error: ninja: build stopped: subcommand failed.

系统环境变量下,已经添加:D:\Qt\Tools\QtCreator\bin D:\cmake-3.24.2-windows-x86_64\bin

cmake tool: 3.24.2

请问如何解决该问题呢?

  • 写回答

2条回答 默认 最新

  • 伍六七0804 2022-10-17 11:27
    关注

    要把代码贴出来才能看出问题。应该就是少写了函数返回值 丢了分号之类的问题

    评论

报告相同问题?

问题事件

  • 创建了问题 10月17日

悬赏问题

  • ¥15 如何将这个项目的ssh-TCP,改成ssh3-UDP协议
  • ¥20 ic卡dump文件校检码解密
  • ¥15 关于:接收到的数据不是有效的JSON格式
  • ¥15 apdl语言如何增加受力分析
  • ¥15 算法对比:学校优化算法与蚁群算法对比
  • ¥15 机电一体化系统设计说明书
  • ¥20 sgy数据提取地震波速,有人能回答吗小馋
  • ¥15 python用ARIMA时间预测模型预测数据出错,急!
  • ¥30 为什么后端传给前端vue的河流json数据不在地图中显示出来
  • ¥50 关于弹性波动方程求解的问题: