您的位置:首页 > 其它

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

2016-03-22 14:23 555 查看
最近用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 <typename PointT> static std::string
generateHeader (const pcl::PointCloud<PointT> &cloud,
const int nr_points = std::numeric_limits<int>::max ());


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

修改后代码:

template <typename PointT> static std::string
generateHeader (const pcl::PointCloud<PointT> &cloud,
const int nr_points = (std::numeric_limits<int>::max)());
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: