Monday, July 4, 2016

Set up Visual Studio to use the All-in-one Point Cloud Library PCL

Point Cloud Library (PCL) from http://pointclouds.org is a powerful library for working with point clouds. But the downloadable binaries are outdated and compiling the latest source code can be a bit of a pain. Fortunately, you can get more recent all-in-one PCL binaries from this blog site http://unanancyowen.com/?p=1255&lang=en for use in your projects.

Installing PCL All-in-one

  1. Just follow the instructions on the site to download and install a version of PCL e.g. PCL 1.7.2 All-in-one Installer MSVC2015 X64, for your development environment.
  2. Also download a suitable Visual Studio property sheet e.g. PCL Property Sheet, and save the file on your machine as e.g. pclPropertySheet.props.
  3. After installing, add the bin folder locations of PCL and VTK to the Windows PATH environment variable, as shown below.

Setting up Visual Studio
  1. Run Visual Studio. Select File | New | Project.
    The New Project dialog appears.

  2. Select Templates | Visual C++ | General. Choose Empty Project. Type in a project Name e.g. HelloPCL. Browse to a Location. Click OK.

    The project is created.

  3. In the top right pane, click the Property Manager tab.

    The Property Manager tab is activated.

  4. Click the Add Existing Property Sheet icon, as shown above.
    The Add Existing Property Sheet dialog box appears.

  5. Browse and select the previously downloaded property sheet e.g. pclPropertySheet.props. Click Open.

    The property sheet is loaded.
  6. Now create a new C++ source file, e.g. main.cpp.



  7. In the C++ file, type in PCL include header file(s) and classes, as shown below.




  8. Optional: the PCL headers and classes may display wavy red under lines. If so make sure you are working in the correct configuration. In this example, the environment is for x64. Change the configuration to x64 from x86.

    Visual Studio now recognizes the PCL headers and classes
    .

2 comments:

Unknown said...

I'm using pcl 1.10.1 - the newest version up-to-date.
I tried downloading a property sheet from https://gist.github.com/UnaNancyOwen/d2c380603a4642525b5c
and edit the file to the versions of the libraries I downloaded.
It still doesn't work.
Is there any official property sheet?

dominoc925 said...

I don't use this method anymore and it is easier to use cmake to generate the make files. You can try using it to generate the VS solution files.