【问题标题】:GDCM vtk msvc2013GDCM vtk msvc2013
【发布时间】:2017-04-07 14:27:51
【问题描述】:

我已经使用 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 版本存在。 有人能救我吗?

【问题讨论】:

  • vtkgdcm 的输出是否可能是您要查找的 dll?由于 vtkImageMapToColors16.h(116) 中的编译错误,该项目似乎无法构建。
  • 亲爱的 Jamey,谢谢,但这不是问题所在。问题是当我构建没有shared_lib 选项的VTK 时,它只创建了.lib 文件而没有.dll。我可以克服这个问题,但使用 shared_libs 进行重建。但是现在还有另一个问题:我无法构建 GDCM ALL_BUILD。它给了我这个错误:链接:致命错误LNK1104:无法打开文件'..\..\..\..\bin\Debug\vtkgdcm.lib'

标签: cmake vtk gdcm


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-10
    • 2011-07-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多