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
请问如何解决该问题呢?