Search code examples
cmakevisual-studio-2017vtkitk

Errors building project in Visual Studio 2017


For my work I want to implement an Add-on for the open source project "ITK-Snap". Using the official guide, I built ITK,VTK with CMake and installed them as well as Qt5.6. ITK-VTK CMakeenter image description here After then using CMake to build ITK-Snap and trying to build the project with Visual Studio 2017 will lead to about 150 Errors, most of them include a submodule used in ITK-Snap named greedy. I'll include all of the different error codes + messages in the screenshots, but keep in mind that many errors occur many times.

Errors

Maybe I have some error in the CMake settings? Thanks for Your help.


Solution

  • All 3 of those projects have a directory called CMake in their source code. Deciding to make it also the build directory is a poor choice at best. Two good choices would be C:/FWF/ITK/build and C:/FWF/ITK-build. The second choice is even better because it allows searching only the source directory, and excluding the bigger build directory. Same logic holds for VTK and ITK-Snap.

    Your errors are coming from ITK-Snap's 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.