0
votes

I am following the official tutorial here to get started with the Point Cloud Library. But unfortunately I can get it working because I encountered the problem just from the very beginning, which says that namespace "pcl" has no member named PointCloud (in line 8 of the tutorial: pcl::PointCloud<.....>). The header files I used are:

#include <iostream>
#include <pcl-1.8/pcl/point_types.h>
#include <pcl-1.8/pcl/filters/passthrough.h>
#include <pcl-1.8/pcl/point_cloud.h>

I also added $(PCL_ROOT)\include and other $(PCL_ROOT)\3rdParty "include"s to Project Properties\Configuration Properties\VC++ Directories\Include Directories\,

besides that,

$(PCL_ROOT)\lib together with $(PCL_ROOT)\3rdParty "lib"s were also added to the Project Properties\Configuration Properties\VC++ Directories\Library Directories.

Further I added relevant libs to Project Properties\Configuration Properties\Linker\Input\Additional Dependencies, namely, pcl_common_debug.lib and pcl_filters_debug.lib.

$(PCL_ROOT) is the path to where the PCL installed and has already been added to the environment. The platform was set to x64 in debug mode. I was using the latest version of PCL, i.e. PCL-1.8.1-AllInOne-msvc2015-win64 on VS 2015 (64bit) on a windows 10 pro machine.

I googled the problem but still can't figure out what was wrong. Did I set up anything improperly? I very appreciate any help from you! Thank you so much.

The error I got is shown below: error

2
My bet is that it is not the first error shown in output window... Btw post the error verbatimRama
Hi @Rama, thank you for your comment. I uploaded a snapshot of the error. Would you mind taking a look at it? Thank you.tmsh

2 Answers

1
votes

pcl::PointCloud is defined in the pcl/point_cloud.h header. Assuming $(PCL_ROOT) is the actual instalation folder, you are incorrectly adding pcl-1.8 to your include statements. It is normally invoked simply as

#include <iostream>
#include <pcl/point_types.h>
#include <pcl/filters/passthrough.h>
#include <pcl/point_cloud.h>
1
votes

Try to add these lines into cmakelists, I have solved the problem by this.

find_package(PCL REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})