I use VTK for a lot. Most of class work well but now I got this error report after I want to use volume renderer.
Generic Warning: In C:\vcpkg\buildtrees\vtk\src\edd2e5233f-f32830fbf2.clean\Rendering\Volume\vtkGPUVolumeRayCastMapper.cxx, line 42
Error: no override found for 'vtkGPUVolumeRayCastMapper'.
This is my cmakelist:
cmake_minimum_required(VERSION 3.5)
project(Reconstruction VERSION 0.1 LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
message("CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
find_package(VTK REQUIRED)
if(NOT DEFINED VTK_QT_VERSION)
message("VTK QT VERSION not defined, default set to 5")
set(VTK_QT_VERSION 5)
endif()
set(qt_components Core Gui Widgets)
if(${VTK_QT_VERSION} VERSION_GREATER_EQUAL 6)
list(APPEND qt_components OpenGLWidgets)
endif()
list(SORT qt_components)
find_package(Qt${VTK_QT_VERSION} QUIET
REQUIRED COMPONENTS ${qt_components}
)
foreach(_qt_comp IN LISTS qt_components)
list(APPEND qt_modules "Qt${VTK_QT_VERSION}::${_qt_comp}")
endforeach()
message (STATUS "VTK_VERSION: ${VTK_VERSION}, Qt Version: ${Qt${VTK_QT_VERSION}Widgets_VERSION}")
file(GLOB MAIN main.cpp)
file(GLOB CONTROLLER controller/**)
file(GLOB SERVICE service/**)
file(GLOB DATAIO data_io/**)
# CMAKE_AUTOMOC in ON so the MOC headers will be automatically wrapped.
add_executable(Reconstruction MACOSX_BUNDLE
${MAIN} ${CONTROLLER} ${SERVICE} ${DATAIO})
if (Qt${VTK_QT_VERSION}Widgets_VERSION VERSION_LESS "5.11.0")
qt5_use_modules(Reconstruction ${qt_components})
else()
target_link_libraries(Reconstruction ${qt_modules})
endif()
target_link_libraries(Reconstruction ${VTK_LIBRARIES})
# vtk_module_autoinit is needed
vtk_module_autoinit(
TARGETS Reconstruction
MODULES ${VTK_LIBRARIES}
)
vtk 9 is installed via vcpkg and cmake generate information as below:
1> CMake generation started for configuration: 'x64-Debug'.
1> Command line: "C:\Windows\system32\cmd.exe" /c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G "Ninja" -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="D:\work\Reconstruction\out\install\x64-Debug" -DCMAKE_CXX_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x64/cl.exe" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "D:\work\Reconstruction" 2>&1"
1> Working directory: D:/work/Builded/build_Reconstruction
1> [CMake] -- The CXX compiler identification is MSVC 19.29.30133.0
1> [CMake] -- Detecting CXX compiler ABI info
1> [CMake] -- Detecting CXX compiler ABI info - done
1> [CMake] -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x64/cl.exe - skipped
1> [CMake] -- Detecting CXX compile features
1> [CMake] -- Detecting CXX compile features - done
1> [CMake] CMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
1> [CMake] -- Looking for C++ include pthread.h
1> [CMake] -- Looking for C++ include pthread.h - not found
1> [CMake] -- Found Threads: TRUE
1> [CMake] -- Found JsonCpp: C:/vcpkg/installed/x64-windows/debug/lib/jsoncpp.lib (found suitable version "1.9.3", minimum required is "0.7.0")
1> [CMake] -- Found OGG: C:/vcpkg/installed/x64-windows/debug/lib/ogg.lib
1> [CMake] -- Found THEORA: C:/vcpkg/installed/x64-windows/debug/lib/theora.lib
1> [CMake] -- Found NetCDF: C:/vcpkg/installed/x64-windows/include (found version "4.7.4")
1> [CMake] -- Searching for PEGTL
1> [CMake] -- Searching for PEGTL - found target taocpp::pegtl
1> [CMake] -- Found LibXml2: C:/vcpkg/installed/x64-windows/debug/lib/libxml2.lib (found version "2.9.12")
1> [CMake] -- Found ZLIB: optimized;C:/vcpkg/installed/x64-windows/lib/zlib.lib;debug;C:/vcpkg/installed/x64-windows/debug/lib/zlibd.lib (found version "1.2.11")
1> [CMake] -- Found LibHaru: optimized;C:/vcpkg/installed/x64-windows/lib/libhpdf.lib;debug;C:/vcpkg/installed/x64-windows/debug/lib/libhpdfd.lib (found suitable version "2.4.0-dev", minimum required is "2.4.0")
1> [CMake] -- Found OpenGL: opengl32 found components: OpenGL
1> [CMake] -- Found PNG: optimized;C:/vcpkg/installed/x64-windows/lib/libpng16.lib;debug;C:/vcpkg/installed/x64-windows/debug/lib/libpng16d.lib (found version "1.6.37")
1> [CMake] -- Found SQLite3: C:/vcpkg/installed/x64-windows/include (found version "3.36.0")
1> [CMake] -- Found LibPROJ: optimized;C:/vcpkg/installed/x64-windows/lib/proj.lib;debug;C:/vcpkg/installed/x64-windows/debug/lib/proj_d.lib (found version "7.2.1")
1> [CMake] -- Found Eigen3: C:/vcpkg/installed/x64-windows/include/eigen3 (found version "3.3.9")
1> [CMake] -- Found EXPAT: optimized;C:/vcpkg/installed/x64-windows/lib/libexpat.lib;debug;C:/vcpkg/installed/x64-windows/debug/lib/libexpatd.lib (found version "2.4.1")
1> [CMake] -- Found double-conversion: C:/vcpkg/installed/x64-windows/debug/lib/double-conversion.lib
1> [CMake] -- Found LZMA: optimized;C:/vcpkg/installed/x64-windows/lib/lzma.lib;debug;C:/vcpkg/installed/x64-windows/debug/lib/lzmad.lib (found version "5.2.5")
1> [CMake] -- Found utf8cpp: C:/vcpkg/installed/x64-windows/include/utf8cpp
1> [CMake] -- Found JPEG: optimized;C:/vcpkg/installed/x64-windows/lib/jpeg.lib;debug;C:/vcpkg/installed/x64-windows/debug/lib/jpeg.lib (found version "62")
1> [CMake] -- Found TIFF: optimized;C:/vcpkg/installed/x64-windows/lib/tiff.lib;debug;C:/vcpkg/installed/x64-windows/debug/lib/tiffd.lib (found version "4.3.0")
1> [CMake] -- Found Freetype: optimized;C:/vcpkg/installed/x64-windows/lib/freetype.lib;debug;C:/vcpkg/installed/x64-windows/debug/lib/freetyped.lib (found version "2.11.0")
1> [CMake] VTK QT VERSION not defined, default set to 5
1> [CMake] -- VTK_VERSION: 9.0.20201030, Qt Version: 5.15.2
1> [CMake] -- Configuring done
1> [CMake] -- Generating done
1> [CMake] -- Build files have been written to: D:/work/Builded/build_Reconstruction
1> Extracted CMake variables.
1> Extracted source files and headers.
1> Extracted code model.
1> Extracted toolchain configurations.
1> Extracted includes paths.
1> CMake generation finished.
The code report error is:
vtkSmartPointer<vtkGPUVolumeRayCastMapper> volumeMapperGpu = vtkSmartPointer<vtkGPUVolumeRayCastMapper>::New();
volumeMapperGpu->SetInputData(tmpImg);
Some vtk class such as imageviewer2, marchingcubes all work well.
So I wonder why I got this error.
Thanks for all reply.