error C2059: 语法错误:“::” error C2589: “(”:“::”右边的非法标记

最近用pcl 1.7来编写程序,在程序利用源码中的例子来进行编译的时候,发现编译错误:

错误  31  error C2059: 语法错误:“::”  D:\kinect1\StanfordPCL-master\include\pcl-1.7\pcl\io\pcd_io.h   332
错误  41  error C2612: 基/成员初始值设定项列表中的非法后缀“::” D:\kinect1\StanfordPCL-master\include\pcl-1.7\pcl\correspondence.h  70
错误  42  error C2589: “(”:“::”右边的非法标记    D:\kinect1\StanfordPCL-master\include\pcl-1.7\pcl\correspondence.h  70

错误的代码如下:

  template PointT> static std::string
      generateHeader (const pcl::PointCloud &cloud, 
                      const int nr_points = std::numeric_limits::max ());

感觉和我上次遇到的flann原因是一样的,google了一下,发现是系统函数与pcl中的max函数冲突导致的,修改如下,添加括号
修改后代码:

template PointT> static std::string
      generateHeader (const pcl::PointCloud &cloud, 
                      const int nr_points = (std::numeric_limits::max)());

你可能感兴趣的:(pcl)