c++visual-studiopoint-cloud-library

pcl::io::loadPCDFile Could not find file 'gArBaGe'


I'm using a really simple code example I found in a tutorial.

When I try to use the pcl::io::loadPCDFile no metter how I try to parameterize it, but ofc I give it valid path with valid point cloud, it always logs:

[pcl::PCDReader::read] Could not find file '(ў}~═'.

or a similar 5 character long garbage. I assume the string gets corrupted somehow but the worriing things are:

  1. I already used the recommended way to instal PCL using vcpkg package manager,
  2. I tryed with the installer too downloaded from github: PCL-1.13.1-AllInOne-msvc2022-win64.exe

In both cases I experienced the same issue, and for an extra fun fact, the pcl::io::savePCDFile works perfectly.


Solution

  • So the problem was I mixed up 2 ways to install the lib which led to UB. Initially I followed the instructions of this installation guide, followed the link to download PCL and it led me to this download page. I installed vcpkg and after that I used the installation command:

    vcpkg install pcl
    

    After the installation I followed the original setup guide and I started to add the things to the VS project and this was incorrect and unnecessary.

    Instead I found the this guide, and the solution within what was the following command right after the installation proces finishes.

    vcpkg integrate install
    

    This will automatically setup the include and lib configurations for VS, and in the project properties there is no need for further configuration.