Background
We have a small app that shows Point Cloud points. previously our app was using PCL 1.9.1 with its dependencies (boots 1.59.0, Eigen 3.3.7, Flann 1.8.5, VTK 8.2.0 with qt 5.7.1, QHull 8.0.2, OpenNi2 2.2.0.33) and QVTKWidget for visualization. The App was working totally fine but we came to know that in the new version of VTK 9 the QVTKWidget is deprecated and if we update the PCL 1.12.1 version then we need to update the Widget from QVTKWidget to its alternative QVTKOpenGLNativeWidget.
Error Description
So to update the PCL version from 1.9.1 to 1.12.1 we have downloaded PCL-1.12.1-AllInOne-msvc2019-win64 pre-build binaries from PCL's official GitHub release page. extracts all binaries with their dependencies updated our project CMake file and links new PCL binaries with our project first when we replaced #include <QVTKWidget.h> to #include <QVTKOpenGLNativeWidget.h> then this header file is not found. our Cmake and everything was correct. after some investigation, we discovered that the VTK version was packed with PCL-1.12.1-AllInOne-msvc2019-win64 pre-build binaries that are without QT support so that's why it does not have any GUI or QT-supported header files and libs.
Then we build VTK 9.1 (with all of its GUI components) with QT 5.15 locally and place it in the PCL dependencies directory /3rdParty/VTK
link will our App. the header not found issue is resolved but we got an undefined symbol error of newly updated widget QVTKOpenGLNativeWidget.

Environment:
- OS: Windows 11
- Compiler: MSVC 2019
- PCL Version: 1.12.1
- PCL Type: Pre-build Binaries PCL-1.12.1-AllInOne-msvc2019-win64
Solution
After some investigation, we found that QVTKOpenGLNativeWidget is defined in the GUISupportQt component of VTK while in PCLConfig.cmake (shipped with PCL-1.12.1-AllInOne-msvc2019-win64) at line 494 are not including VTK GUISupportQt component that's why we're getting undefined symbol errors. these are the components that are only included in shipped PCLConfig,cmake a file
# VTK components required by PCL
set(PCL_VTK_COMPONENTS "ChartsCore;CommonColor;CommonComputationalGeometry;CommonCore;CommonDataModel;CommonExecutionModel;CommonMath;CommonMisc;CommonTransforms;FiltersCore;FiltersExtraction;FiltersGeneral;FiltersGeometry;FiltersModeling;FiltersSources;ImagingCore;ImagingSources;InteractionImage;InteractionStyle;InteractionWidgets;IOCore;IOGeometry;IOImage;IOLegacy;IOPLY;RenderingAnnotation;RenderingCore;RenderingContext2D;RenderingLOD;RenderingFreeType;ViewsCore;ViewsContext2D;RenderingOpenGL2")
we have to update the above line with the following line which included all of the following VTK components GUISupportQt, GUISupportQtQuick, GUISupportQtSQL, RenderingQt, ViewsQt, CommonSystem;glew, RenderingUI, vtksys, freetype, kissfft, pugixml, loguru, InfovisCore, FiltersHybrid, FiltersTexture, ImagingGeneral;ImagingHybrid, FiltersStatistics, ParallelDIY, ParallelCore, ImagingColor, DICOMParser, metaio;png, tiff, zlib, jpeg;fmt, doubleconversion, IOXML, IOXMLParser, jsoncpp, lz4, lzma, and expat. as
set(PCL_VTK_COMPONENTS "ChartsCore;CommonColor;CommonComputationalGeometry;CommonCore;CommonDataModel;CommonExecutionModel;CommonMath;CommonMisc;CommonTransforms;FiltersCore;FiltersExtraction;FiltersGeneral;FiltersGeometry;FiltersModeling;FiltersSources;ImagingCore;ImagingSources;InteractionImage;InteractionStyle;InteractionWidgets;IOCore;IOGeometry;IOImage;IOLegacy;IOPLY;RenderingAnnotation;RenderingCore;RenderingContext2D;RenderingLOD;RenderingFreeType;ViewsCore;ViewsContext2D;RenderingOpenGL2;GUISupportQt;GUISupportQtQuick;GUISupportQtSQL;RenderingQt;ViewsQt;CommonSystem;glew;RenderingUI;vtksys;freetype;kissfft;pugixml;loguru;InfovisCore;FiltersHybrid;FiltersTexture;ImagingGeneral;ImagingHybrid;FiltersStatistics;ParallelDIY;ParallelCore;ImagingColor;DICOMParser;metaio;png;tiff;zlib;jpeg;fmt;doubleconversion;IOXML;IOXMLParser;jsoncpp;lz4;lzma;expat")
also after adding this the unresolved symbol error are resolved but io_ply.dll were not installing automatically so again we have to update PCLConfig,cmake at line 453 and 464 to add io_ply module so that its dll should automatically be installed.
the line 453 and 464 were looks like this after updating
set(pcl_all_components common kdtree octree search sample_consensus filters 2d geometry io io_ply features ml segmentation visualization surface registration keypoints tracking recognition stereo outofcore people)
set(pcl_io_int_dep common octree io_ply )
Suggestion
My personal suggestion is that the pre-build binaries PCL-1.12.1-AllInOne- should work plug and play like manner. it should be packed and shipped with VTK (already build all of its modules with qt GUI support too) binaries and the above-required updates in PCLConfig.cmake file. if not that case then at least document the above steps in docs that how some new developer can use the above GUI components.
Refrence
I have found the above solution only on the following page on the internet thanks to him for proving this solution
https://mangoroom.cn/cpp/pcl-vtk9-x-viewer-hosted-on-qt-widget.html
kind: compile error status: triage