最近学习平面参数化,下载了很多别人的代码,在自己的电脑上运行有很多问题
1 C3681 “to_string”:找不到标识符
这个错误提示仅在预编译后,之前代码没提示,运行时提示运行失败。
这是因为缺少命名空间,至于为什么不在写代码的时候提示没有类或者函数,我猜大概是因为在出现to_string的地方之前没有 namespace,在出现之后有namespace std。
string x = to_string(mesh2D.cloud.points[i].x);
namespace std;
2 提示Assertion failed: px != 0, file D:\PCL1.10.1(done)\PCL 1.10.1\3rdParty\Boost\include\boost-1_72\boost\smart_ptr\shared_ptr.hpp, line 734
1 可能是智能指针没有初始化:pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
2 点云集为空,即智能指针指向为空
3 直接原因:改函数返回值在函数类型那里是点云集,但是return 0 ,所以后面显示的是空点云所以报错空指针