#include <string>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
int main (int argc, char** argv){
pcl::PCLPointCloud2::Ptr cloud_blob (new pcl::PCLPointCloud2);
string pcdfile = (string) argv[1];
pcl::PCDReader reader;
reader.read (pcdfile, *cloud_blob);
std::cerr << "PointCloud before filtering: " << cloud_blob->width * cloud_blob->height << " data points." << std::endl;
return 0;
}
采用cmake3.1编译,报错:
error: ‘string’ was not declared in this scope.
解决方案:
1. 添加
using namespace std;
或者
2. 修改
std::string pcdfile = (string) argv[1];