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.
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- cmake, cpp
- Lĩnh vực
- build-system
Hướng nghiên cứu
Bắt đầu bằng việc xem xét PCLConfig.cmake quanh các dòng 453, 464 và 494, sau đó kiểm tra cách gói Windows PCL-1.12.1 cung cấp các thành phần GUISupportQt của VTK và io_ply.dll. So sánh cấu hình được báo cáo với các dependency có trong gói và xác định liệu bản sửa lỗi thuộc về gói hay tài liệu. Hoàn tất khi các liên kết đến Qt widget và io_ply.dll được cài đặt tự động, hoặc khi phần thiết lập cần thiết được ghi lại trong tài liệu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- C++
- Star
- 11.2k
- Fork
- 4.7k
- Merge trung bình
- 6 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 10
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của PointCloudLibrary/pcl
-
kind: bug status: triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
PointCloudLibrary/pcl#6536 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
PointCloudLibrary/pcl#6509 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
kind: bug status: triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
PointCloudLibrary/pcl#6537 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
[cmake] QHULL/FLANN dll missing when linking single moduleCó thể đã có người làm @SIDDARTHAREDDY8 đã nhận 6 ngày trước. Đang mởkind: bug module: cmake
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 50/100
PointCloudLibrary/pcl#6522 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
kind: bug status: triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
PointCloudLibrary/pcl#6395 ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của PointCloudLibrary/pcl
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
HarperFast/rocksdb-js#1131 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/daemon bug good first issue platform/linux priority/p2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ToshiNamura/Deimos#5 ·
-
needs-format
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Niko1221/Strata#6251 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 5 ngày
-
[Bug]: NP 管理器文件编辑器里删除键无效Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
metasequoiaime/msime#11666 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
patrick-hudson/put.gd-desktop#1679 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày