我已经用MSVC2013成功构建了VTK 7.1.1和Qt 5.3.2。我已经下载了GCDM并使用Cmake配置了没有shared_lib。我可以在配置了CMake的GDCM解决方案中构建ALL_BUILD项目,但是无法构建INSTALL项目并且它给了我这个错误:
1>------ Build started: Project: vtkgdcm, Configuration: Debug x64 ------
1> vtkImageMapToColors16.cxx
1>c:\vtk\gdcm-2.6.7\utilities\vtk\vtkImageMapToColors16.h(116): error C2555: 'vtkImageMapToColors16::GetMTime': overriding virtual function return type differs and is not covariant from 'vtkObject::GetMTime'
1> C:\VTK\VTK-7.1.1\Common\Core\vtkObject.h(107) : see declaration of 'vtkObject::GetMTime'
2>------ Build started: Project: INSTALL, Configuration: Debug x64 ------
2> -- Install configuration: "Debug"
2> CMake Error at cmake_install.cmake:31 (file):
2> file INSTALL cannot find "C:/VTK/bin/../../../bin/vtkCommonCore-7.1.dll".
2>
2>
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: The command "setlocal
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: "C:\Program Files\CMake\bin\cmake.exe" -DBUILD_TYPE=Debug -P cmake_install.cmake
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: :cmEnd
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: :cmErrorLevel
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: exit /b %1
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: :cmDone
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: :VCEnd" exited with code 1.
========== Build: 0 succeeded, 2 failed, 17 up-to-date, 0 skipped ==========
它说它找不到vtkCommonCore-7.1.dll,并且我的vtk上不存在该文件,但该文件的.lib版本存在。 有人可以救我吗?
答案 0 :(得分:0)
我这样解决了我的问题: 首先,我通过使用shared_libs选项ON构建VTK来构建.dll缺少的文件。
其次,正如Jamey所说,我通过在vtkImageMapToColors16中更改GetMTime的定义来修复错误C2555,显然VTK版本7.1.1与GDCM 2.6不兼容。所以我将getMTime函数的输出类型从long int更改为vtkObject :: GetMTime中虚函数的输出。