Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pcl]LNK2019 Unresolved external symbol "public: __cdecl pcl::Poisson<struct pcl::PointXYZ>::Poisson<struct pcl::PointXYZ>(void)" #21694

Closed
WangZP10969 opened this issue Nov 27, 2021 · 19 comments
Assignees
Labels
requires:repro The issue is not currently repro-able

Comments

@WangZP10969
Copy link

WangZP10969 commented Nov 27, 2021

Describe the bug
PCL compiled based on master pcl[core,vtk]

When compiling
pcl::Poisson<pcl::PointXYZ> Poisson;
and pcl_surfaced.lib has been correctly configured into the linker.

hint
[pcl]LNK2019 Unresolved external symbol "public: __cdecl pcl::Poisson::Poisson(void)"

Environment

  • OS: Windows11
  • Compiler: VS2022 17.0.1(PCL compiled with VS2019)

To Reproduce
Steps to reproduce the behavior:

  1. ./vcpkg install pcl[core,vtk]
  2. Compiling pcl::Poisson<pcl::PointXYZ> Poisson;

Expected behavior

Failure logs

Additional context

@JonLiu1993 JonLiu1993 self-assigned this Nov 29, 2021
@JonLiu1993 JonLiu1993 added the requires:repro The issue is not currently repro-able label Nov 29, 2021
@JonLiu1993
Copy link
Member

@WangZP10969 ,Thanks for posting this issue, can you install pcl[core,vtk] successfully with Visual Studio 2022?
and Could you please provide the detail error log?

@JackBoosY JackBoosY self-assigned this Dec 1, 2021
@JackBoosY
Copy link
Contributor

Ping @WangZP10969

@JackBoosY JackBoosY added the requires:more-information This Issue requires more information to solve label Dec 1, 2021
@WangZP10969
Copy link
Author

WangZP10969 commented Dec 1, 2021

@WangZP10969 ,Thanks for posting this issue, can you install pcl[core,vtk] successfully with Visual Studio 2022? and Could you please provide the detail error log?

@JonLiu1993 Sorry for the late reply
I cannot compile pcl based on vs2022, as I mentioned before
#18855 (comment)
I just compiled it on vs2019 and used it on vs2022
For the problem of pcl::possion, this is a compilation problem, the symbols are missing in the lib

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2019	unresolved external symbol "public: __cdecl pcl::Poisson<struct pcl::PointXYZ>::Poisson<struct pcl::PointXYZ>(void)" (??0?$Poisson@UPointXYZ@pcl@@@pcl@@QEAA@XZ) referenced in function "class std::vector<class std::shared_ptr<struct wvl::_3DObjectModel::_WObjectModel3D>,class std::allocator<class std::shared_ptr<struct wvl::_3DObjectModel::_WObjectModel3D> > > __cdecl wvl::_3DObjectModel::triangulate_object_model_3d(class std::vector<class std::shared_ptr<struct wvl::_3DObjectModel::_WObjectModel3D>,class std::allocator<class std::shared_ptr<struct wvl::_3DObjectModel::_WObjectModel3D> > > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > const &,class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)" (?triangulate_object_model_3d@_3DObjectModel@wvl@@YA?AV?$vector@V?$shared_ptr@U_WObjectModel3D@_3DObjectModel@wvl@@@std@@V?$allocator@V?$shared_ptr@U_WObjectModel3D@_3DObjectModel@wvl@@@std@@@2@@std@@AEBV34@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@4@AEBV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@4@2AEAV54@@Z)	libwvl	C:\FILE\WVLWZP\wvl\Build\wvl3DObjectModel.obj	1	

1638352211(1)

@JackBoosY JackBoosY removed the requires:more-information This Issue requires more information to solve label Dec 1, 2021
@JackBoosY
Copy link
Contributor

Can you please also provide a simple code to repro this?

@WangZP10969
Copy link
Author

WangZP10969 commented Dec 1, 2021

Can you please also provide a simple code to repro this?

@JackBoosY I tested on windows10 vs2019 16.11.7, and use .\vcpkg export pcl[core,vtk]:x64-windows --zip to get the pcl.

This is the project files:
TEST.zip
You need make sure the "vcpkg.cmake" path is suit to yours.
CMakelists.txt Line3:
set(CMAKE_TOOLCHAIN_FILE "C:/vcpkg/vcpkg-export-20211201-210741/scripts/buildsystems/vcpkg.cmake")

I used cmake gui to genrating project:
image

Building the "Test" on debug or release and result like this:
image

@JackBoosY
Copy link
Contributor

I can't repro this issue when using changes in PR #21788, can you confirm that?

And please use find_package(PCL CONFIG REQUIRED) instead.

@WangZP10969
Copy link
Author

WangZP10969 commented Dec 2, 2021

I can't repro this issue when using changes in PR #21788, can you confirm that?

And please use find_package(PCL CONFIG REQUIRED) instead.

@JackBoosY It didn't work after modifying find_package
I am using the master version earlier than PR #21788, I think I need to test on the new PR.

Would you help me test pcl::ConvexHull by the way? In the previous version, I need to make changes #18855 (comment) to be used normally
The test project file is as follows
TEST.zip

@JackBoosY
Copy link
Contributor

I can't repro this issue when using changes in PR #21788, can you confirm that?
And please use find_package(PCL CONFIG REQUIRED) instead.

@JackBoosY It didn't work after modifying find_package I am using the master version earlier than PR #21788, I think I need to rebuild the test in this PR

Would you help me test pcl::ConvexHull by the way? In the previous version, I need to make changes #18855 (comment) to be used normally The test project file is as follows TEST.zip

Build succes with my changes.

@WangZP10969
Copy link
Author

WangZP10969 commented Dec 2, 2021

@JackBoosY Doesn't work for me...

git clone https://github.com/microsoft/vcpkg
cd vcpkg
git fetch origin pull/21788/head
git checkout FETCH_HEAD
 ./bootstrap-vcpkg.bat
.\vcpkg install qt5:x64-windows pcl[vtk]:x64-windows vtk[atlmfc,qt,utf8]:x64-windows omplapp:x64-windows gtest:x64-windows orocos-kdl:x64-windows urdfdom:x64-windows nlopt:x64-windows
.\vcpkg export pcl[vtk]:x64-windows --raw

image

@WangZP10969
Copy link
Author

WangZP10969 commented Dec 3, 2021

I tried to compile only pcl, still the same result

.\vcpkg install pcl[core,vtk]:x64-windows
.\vcpkg export pcl[core,vtk]:x64-windows --raw

I try to modify the port.cmake on this pr to see the effect.

Without modify the port.cmake, both pcl::ConvexHull and pcl::Poisson can not be work
With modify the port.cmake, pcl::ConvexHull can work, but pcl::Poisson still not.

@JackBoosY
Copy link
Contributor

@WangZP10969 Which changes in the port.cmake?

@WangZP10969
Copy link
Author

WangZP10969 commented Dec 6, 2021

@JackBoosY

It’s from there : #18855 (comment)
remove this two(which has “#” front)
1.fix-find-qhull.patch
2.file(REMOVE ${SOURCE_PATH}/cmake/Modules/FindQhull.cmake)

vcpkg_from_github(
    OUT_SOURCE_PATH SOURCE_PATH
    REPO PointCloudLibrary/pcl
    REF f36a69a5e89953708990c4669317f989d532cf08 # pcl-1.12.0
    SHA512 dbbd0adbb08949ddef2789e0021b6ca9727be33c7193d0bb135c61def09a42ed6a71333f06b6fad407010ecb4b73c19f087f7520386b92a008e90c254eafe422
    HEAD_REF master
    PATCHES
        add-gcc-version-check.patch
        fix-check-sse.patch
#        fix-find-qhull.patch
        fix-numeric-literals-flag.patch
        pcl_config.patch
        pcl_utils.patch
        remove-broken-targets.patch
        fix-cmake_find_library_suffixes.patch
        fix-pkgconfig.patch # Remove this patch in the next update
        fix-find-libusb.patch
        install-examples.patch
)

#file(REMOVE "${SOURCE_PATH}/cmake/Modules/FindQhull.cmake"
#            "${SOURCE_PATH}/cmake/Modules/Findlibusb.cmake"
#)
file(REMOVE "${SOURCE_PATH}/cmake/Modules/Findlibusb.cmake")

@WangZP10969
Copy link
Author

WangZP10969 commented Dec 6, 2021

The test is still the same result just now, the following is the test record
vcpkg.txt
CMake.txt
TEST.zip

@JackBoosY
Copy link
Contributor

@WangZP10969 I can't repro your issue using the test project you provided.
And I found something interesting:

Starting package 125/125: pcl:x64-windows
Installing package pcl[core,vtk]:x64-windows...
Elapsed time for package pcl:x64-windows: 13.25 s

It seems that you use the binarycaching here, please use command:

.\vcpkg install pcl[core,vtk]:x64-windows --editable

Then try again.

@JackBoosY JackBoosY added the requires:more-information This Issue requires more information to solve label Dec 9, 2021
@WangZP10969
Copy link
Author

WangZP10969 commented Dec 9, 2021

Thank you very much for your tips, I only deleted the vcpkg folder, but did not clean up the cache in other locations.
I will test as soon as possible

@WangZP10969
Copy link
Author

WangZP10969 commented Dec 9, 2021

@JackBoosY

I tried to add the editable option, but only recompiled pcl, so I deleted all the files under C:\Users\WangZP\AppData\Local\vcpkg and C:\vcpkg and recompiled. During the cache retrieval of the installation, it was prompted that 0 installation packages were retrieved.

The result has not changed after the test. Are there any other caches that need to be deleted?

This is the test record, I only kept the downloads folder, and deleted everything else.
vcpkg20211210.txt

@JackBoosY JackBoosY removed the requires:more-information This Issue requires more information to solve label Dec 10, 2021
@WangZP10969
Copy link
Author

WangZP10969 commented Dec 10, 2021

I think there may be some reasons why PCL did not find QHull, so HAS_QHULL will not be set to ON, which also caused the Possion module to not be compiled.
QHull can be found by directly using PCL itself without adding Patch, but Possion has not yet been compiled
I think my situation may not be accidental. After all, this solution that directly uses PCL was provided by someone else
#17662 (comment)
#18855 (comment)
But if it really can't reproduce, I think waiting for 1.12.1 is also a solution, this version will have some new modifications.
PointCloudLibrary/pcl#4923 (comment)

@WangZP10969
Copy link
Author

I've bypassed this issue by including poisson.hpp directly and I think I can close this issue.
Thanks a lot for your advice and help.

@JackBoosY
Copy link
Contributor

Sorry but I still can't repro this issue, feel free to open it when you stuck again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
requires:repro The issue is not currently repro-able
Projects
None yet
Development

No branches or pull requests

3 participants