-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
[compile error] Linker error: libpcl_io_ply.a is not added to ${PCL_LIBRARIES}, nor is it linked to libpcl_io. #4422
Comments
Same problem here. @tsijs , do you have a solution now? |
https://github.com/PointCloudLibrary/pcl/blob/pcl-1.11.1/io/CMakeLists.txt#L3 io subsystem only declares dependency on "common" and "octree" subsystems, so only those dependencies appear in PCLConfig.cmake. The easiest way to fix this would be to merge pcl_io_ply into pcl_io target. Another option might be to make pcl_io_ply as subsubsystem of pcl_io subsystem. I think there are additional problems with static libraries. Dependencies on third-party libraries like boost, vtk, etc also need to be specified for in EXT_DEPS, which seems to be missing here: I am not sure why pcl project decided to implement custom script to generate PCLConfig.cmake instead of just using cmake install(EXPORT): https://cmake.org/cmake/help/latest/command/install.html#export |
Maybe a little too late to the party, but I worked around the problem by adding the io lib manually in my own cmakelist. It doesn't deserve an elegance medal, but it works: set(PCL_PLY_IO_LIBRARY_PATH "${VCPKG_ROOT_DIR}/installed/x64-linux/lib/libpcl_io_ply.a") target_link_libraries(${PROJECT_NAME} |
I just ran into the same problem and can be reproduced with the minimal example below:
CMakeLists.txt
main.cpp
|
This issue can NOT easily fixed.
However, pcl declares dependencies through internal Moreover, pcl does not use the cmake |
the undefined symbol error for |
same error for me, any progress? |
You can add in your CmakeLists something like: |
Still an issue. (Trying to fix the rtabmap vcpkg port for x64-linux static linkage.) |
Tentative patch which keeps the separate lib: Upstream, please choose between keeping separate libs and merging (miriameng@25f22ae). |
I am running into the same issue on Windows. My workaround is additional CMake code: |
run into the issue on linux with vcpkg:(2968c141e31261d374f93b3dae9e6ea1d30004bf) has vcpkg update their version? |
2968c141e31261d374f93b3dae9e6ea1d30004bf is 1.14.1#3 which includes the suggested patch. |
When compiling pcl with vcpkg, and using #include <pcl/io/ply_io.h>, there occures a linker error which happens because
libpcl_io_ply.a is not added to ${PCL_LIBRARIES}, nor is it linked to libpcl_io.a
Please paste the compilation results/errors.
To Reproduce
Output:
lib_pcl_io_ply is not printed in the output.
"<vcpkg_dirdir>/installed/x64-linux/lib/libpcl_io.a(ply_io.cpp.o): In function `pcl::PLYReader::parse(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'" complains about not being able to link to lib_pcl_io_ply.
Remember to reproduce the error in a clean rebuild (removing all build objects and starting build from scratch)
Your Environment (please complete the following information):
If PCL was compiled from source or failure in compiling PCL itself:
If compiling against PCL:
CMakeLists.txt
for simple errors like missingfind_package
ortarget_link_libraries
? - yesPossible Solution
It seems that pcl_io is not linked to pcl_io_ply when building pcl statically, hence it needs pcl_io_ply when linked to, but there is no nice way to obtain the location of pcl_io_ply, because it is not available in the libraries cmake variable.
So my naive proposal would be: either make pcl_io with pcl_io_ply or add it to the libraries variable.
The text was updated successfully, but these errors were encountered: