【发布时间】:2014-08-05 16:09:42
【问题描述】:
我已成功链接我的基本项目,其中仅包含一个 ReadPc.cpp 文件,显然是从 Visual Studio 2010 中的文件读取点云 运行异常抛出后弹出窗口“R6010 abort() has been called”显示 当我设置我的应用程序时,我关注了this tutorial
这是我的代码
#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
int
main (int argc, char** argv)
{
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>);
std::cout << "bejzikl";
if (pcl::io::loadPCDFile<pcl::PointXYZ> ("kitchen.pcd", *cloud) == -1) //* load the file
{
PCL_ERROR ("Couldn't read file test_pcd.pcd \n");
return (-1);
}
std::cout << "Loaded "
<< cloud->width * cloud->height
<< " data points from test_pcd.pcd with the following fields: "
<< std::endl;
for (size_t i = 0; i < cloud->points.size (); ++i)
std::cout << " " << cloud->points[i].x
<< " " << cloud->points[i].y
<< " " << cloud->points[i].z << std::endl;
return (0);
}
问题线似乎是这个 if (pcl::io::loadPCDFile ("kitchen.pcd", *cloud) == -1)
在调试模式下输出显示
First-chance exception at 0x7566812f in Meshes.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0030f36c..
Unhandled exception at 0x7566812f in Meshes.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0030f36c..
The program '[15424] Meshes.exe: Native' has exited with code -529697949 (0xe06d7363).
感谢任何建议
【问题讨论】:
标签: c++ visual-studio-2010 point-cloud-library point-clouds