我是C ++和点云库1.6版的新用户。我想基于点云数据生成图表。我的这是我的cpp文件:
#include <iostream>
#include <vector>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/common/io.h>
#include <boost/make_shared.hpp>
#include <boost/format.hpp>
#include <pcl/graph/point_cloud_graph.h>
int main (int argc, char** argv)
{
pcl::PointCloud <pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud <pcl::PointXYZ>);
if ( pcl::io::loadPCDFile <pcl::PointXYZ>("xyz_new.pcd", *cloud) == -1 )
{
std::cout << "Cloud reading failed." << std::endl;
return (-1);
}
//create a graph based on the cloud
pcl::graph::point_cloud_graph<pcl::PointXYZ> graph(cloud);
}
然而,当我编译它时有错误: 错误1:
C:\Program Files (x86)\PCL 1.6.0\include\pcl-1.6\pcl/graph/point_cloud_graph.h(117): error C2039: 'vertex_bundled' : is not a member of 'boost::vec_adj_list_impl<Graph,Config,Base>'
with
[
Graph=pcl::graph::point_cloud_graph<pcl::PointXYZ>,
Config=boost::detail::adj_list_gen<pcl::graph::point_cloud_graph<pcl::PointXYZ>,boost::vecS,boost::vecS,boost::undirectedS,boost::no_property,boost::no_property,boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ>>,boost::listS>::config,
Base=boost::undirected_graph_helper<boost::detail::adj_list_gen<pcl::graph::point_cloud_graph<pcl::PointXYZ>,boost::vecS,boost::vecS,boost::undirectedS,boost::no_property,boost::no_property,boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ>>,boost::listS>::config>
]
误差2:
C:\Program Files (x86)\PCL 1.6.0\include\pcl-1.6\pcl/graph/point_cloud_graph.h(117): error C2146: syntax error : missing ',' before identifier 'vertex_bundled'
C:\Program Files (x86)\PCL 1.6.0\include\pcl-1.6\pcl/graph/point_cloud_graph.h(117): error C2065: 'vertex_bundled' : undeclared identifier
C:\Program Files (x86)\PCL 1.6.0\include\pcl-1.6\pcl/graph/point_cloud_graph.h(117): error C2955: 'boost::is_same' : use of class template requires template argument list
C:\Program Files (x86)\PCL 1.6.0\3rdParty\Boost\include\boost/type_traits/is_same.hpp(37) : see declaration of 'boost::is_same'
C:\Program Files (x86)\PCL 1.6.0\include\pcl-1.6\pcl/graph/point_cloud_graph.h(117): error C2338: (boost::is_same<typename Base::vertex_bundled, boost::no_property>::value)
文件point_cloud_graph.h来自链接:http://taketwo.github.io/tcs/point__cloud__graph_8h_source.html