2017 年 Visual Studio 构建项目时出错

Errors building project in Visual Studio 2017

对于我的工作,我想为开源项目 "ITK-Snap" 实施一个插件。 使用官方guide, I built ITK,VTK with CMake and installed them as well as Qt5.6. 然后使用 CMake 构建 ITK-Snap 并尝试使用 Visual Studio 2017 构建项目将导致大约 150 个错误,其中大部分包含 ITK-Snap 中使用的名为 greedy 的子模块。我将在屏幕截图中包含所有不同的错误代码和消息,但请记住,许多错误会多次出现。

可能是我的CMake设置有问题? 感谢您的帮助。

这 3 个项目的源代码中都有一个名为 CMake 的目录。决定将它也作为构建目录充其量是一个糟糕的选择。 C:/FWF/ITK/buildC:/FWF/ITK-build 是两个不错的选择。第二种选择甚至更好,因为它只允许搜索源目录,而排除更大的构建目录。 VTK 和 ITK-Snap 的逻辑相同。

您的错误来自 ITK-Snap 的 git sub-module called greedy. The most likely reason is that version of greedy is mismatched to the version of ITK-Snap. Perhaps the author forgot to update the version of greedy in main repository? Try a few different versions of greedy including the latest stable version of everything. If that does not help I suggest to ask on ITK-Snap's mailing list