LNK2019 unresolved external symbol "__declspec(dllimport) public:__cdeclQVTOpenGLNativeWidget::QVTKOpenGLNativeWidget(Class QWidget *, class QFlags<enum Qt::WindowsType>)" while using PCL-1.12.1-AllInOne-msvc2019-win64 binaries.

Abierto
#5,566 9 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
cmake, cpp
Área
build-system

Línea de trabajo

Empieza revisando PCLConfig.cmake alrededor de las líneas 453, 464 y 494; después, inspecciona cómo el paquete de Windows de PCL-1.12.1 proporciona los componentes GUISupportQt de VTK y io_ply.dll. Compara la configuración indicada con las dependencias incluidas en el paquete y determina si la corrección corresponde al paquete o a la documentación. Se considera terminado cuando los enlaces de los widgets de Qt y io_ply.dll se instalan automáticamente, o cuando se documenta la configuración necesaria.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

kind: compile error status: triage

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.
image

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

Lenguaje dominante
C++
Estrellas
11.2k
Forks
4.7k
Merge medio
6 d 13 h
PR fusionados (30 d)
10

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de PointCloudLibrary/pcl

Todos los issues de PointCloudLibrary/pcl

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.