0

我已经使用 MSVC2013 成功构建了 VTK 7.1.1 和 Qt 5.3.2。我已经下载了 GCDM 并配置了没有 shared_lib 的 Cmake。我可以在配置了 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 版本存在。有人能救我吗?

4

1 回答 1

0

我以这种方式解决了我的问题:首先,我通过使用 shared_libs 选项 ON 构建 VTK 来构建 .dll 丢失的文件。

其次,正如 Jamey 提到的,我通过更改 vtkImageMapToColors16 中 GetMTim​​e 的定义来修复错误 C2555,显然 VTK 版本 7.1.1 与 GDCM 2.6 不兼容。所以我把GetMTim​​e函数的输出类型从long int改成了vtkObject::GetMTim​​e中虚函数的输出。

于 2017-04-11T08:14:16.390 回答