Skip to content

[compile error] Linker error: libpcl_io_ply.a is not added to ${PCL_LIBRARIES}, nor is it linked to libpcl_io.  #4422

@tsijs

Description

@tsijs

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

mkdir build && cd build
cmake ..  
make foobar VERBOSE=1 2>&1 | grep pcl_io

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):

  • OS: Ubuntu 18.04 docker
  • Compiler: gcc 9
  • PCL Version 1.11.0
  • PCL Type: Compiled with vcpkg

If PCL was compiled from source or failure in compiling PCL itself:

  • GPU, Kinfu, CUDA enabled? No
  • List and Version of dependencies used - deemed irrelevant
  • Compilation flags are used -O3 -fPIC, nothing else special.

If compiling against PCL:

  • Checked CMakeLists.txt for simple errors like missing find_package or target_link_libraries? - yes

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions