I have been trying to build ITK 5.0 (rc1 or master) in Windows with BUILD_SHARED_LIBS selected (to generate ITK dlls, as I’ve done for previous releases - e.g., 4.12.0), but without success.
My setup is: Windows 8.1 Pro, Visual Studio 2015 and CMake 3.13.1.
The steps I followed can be reproduced by:
(1) Downloading the sources from the ITK5.0rc1 release (https://github.com/InsightSoftwareConsortium/ITK/releases/tag/v5.0rc01) or the master branch;
(2) Configuring CMake with default parameters, select “BUILD_SHARED_LIBS” and deselect “BUILD_TESTING”, and then generate project;
(3) Build using VS 2015 in release mode.
While building the solution, within the ITKCommon project, the following error trace appears:
126>------ Build started: Project: ITKCommon, Configuration: Release x64 ------
126> Building Custom Rule D:/Code/ITK5.0rc01/src/Modules/Core/Common/src/CMakeLists.txt
126> CMake does not need to re-run because D:/Code/ITK5.0rc01/binVC14/Modules/Core/Common/src/CMakeFiles/generate.stamp is up-to-date.
126>d:\code\itk5.0rc01\src\modules\core\common\include\itkEventObject.h(96): error C2071: ‘itk::EventObject::EventFactoryFunction’: illegal storage class
This error (linked to the EventObject class) is then thrown multiple times, when generating code for other itk cxx files, resulting in dozens of projects failed to build.
Thank you in advance.
If i deselect BUILD_SHARED_LIBS, the build is still unsuccessful, throwing the following error:
D:\Code\ITK5.0rc01\src\Modules\Core\Common\src\itkProcessObject.cxx(54): error C2440: ‘initializing’: cannot convert from ‘const char ’ to ‘const char’.
This error seems to be associated with the C++11 standard and compiler conformance options, and may be solved by changing the associated char to a std::string. If modified, the build is finished successfully.