Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Point Cloud Library with Visual Studio 2017

I'm having trouble using Point Cloud Library with Microsoft Visual Studio 2017.

I have installed [PCL-1.8.1-AllInOne-msvc2017-win64.exe] and I've followed the steps mentioned here. to link it to my Visual Studio 2017 project.

My problem is that Visual Studio is not finding the header nor the source files of the library I need. The error I'm getting is as follows: [fatal error C1083: Cannot open include file: 'pcl/io/pcd_io.h': No such file or directory]

To be more precise about my problem, I need to include three PCL header files in order to run thisIterative Closest Point Tutorial

I've followed the following steps to include the PCL into my project:

  • Added the include directories to my project at the Project Properties/Configuration Properties/VC++ Directories/Include Directories field - here I specified the path to my PCL/include directory and to all 3rd party include directories (PCL/3rdParty)
  • Added the library directories on the same settings page (Library Directories field) - hereI specified the path to my PCL/lib directory and to all non-header-only 3rd party libs (Boost, Flann, VTK)
  • Chose the libs to be used in the linker. In Project Properties/Configuration Properties/Linker/Input/Additional Dependencies field. I added all the libs required. As I'm trying to run it in debug mode for now, I've picked the "_debug.lib" library files.
  • Finally, I've added the PCL/bin folder to my system path variable.

Does anyone know if I'm missing something configuration-wise?

I've seen several old posts about incompatibility between older Point Cloud Libraries and older versions of Visual Studio. As far as I understood, the new versions are supposed to work well together, but it's not the case for me.

like image 447
IsmNaj Avatar asked Mar 13 '18 09:03

IsmNaj


3 Answers

Installing pcl is tough because there are dozens of dependencies used along with pcl software. But with with vcpkg,a command line package manager, the installation becomes just like a one liner command.

Use Microsoft vcpkg to build a static or dynamic library for your project automatically. All the dependencies like boost,tiff,openssl,flann,szip,etc will be downloaded and installed by itself. After installing vcpkg type the following on Powershell.

.\vcpkg install pcl:x64-windows-static
like image 181
seccpur Avatar answered Sep 20 '22 13:09

seccpur


The link you referenced is 3-4 years old. At the time, any binary build of PCL for Visual Studio 2012 or later was not provided, and thus. PCL needed to be built with target VS. And every include/library directory of PCL and any related library have to be manually added to setup the IDE. Since PCL is a large-scale collection of libraries, this made it difficult for its users to setup VS.

Now early 2018, binary builds of PCL for VS 2015/2017 and more automatic way to setup VS (e.g., adding library/include directories) using CMake are provided. Thus, installing PCL and creating a VS project using PCL does not take more than 10 minutes. I think you'd better follow the recommended way rather than setting VS by yourself.

like image 45
Tae-Sung Shin Avatar answered Sep 19 '22 13:09

Tae-Sung Shin


the previous answer use vcpkg is good,but is better to use:

.\vcpkg install pcl:x64-windows

It can let you have fewer problems.

like image 23
YuhaoQI Avatar answered Sep 22 '22 13:09

YuhaoQI