Ask Your Question
0

How can I run simple PCL program?

asked 2013-03-30 17:01:17 -0500

Nihad gravatar image

updated 2014-01-28 17:15:58 -0500

ngrennan gravatar image

I want to run a simple PCL program, but it gave error like "Unable to start program c:\GrabPCD\build_pcl\x64\Debug\All_build The system can`t find the file specified."

I am using Windows7 MSVC2010.

#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>

int
  main (int argc, char** argv)
{
  pcl::PointCloud<pcl::PointXYZ> cloud;

  // Fill in the cloud data
  cloud.width    = 5;
  cloud.height   = 1;
  cloud.is_dense = false;
  cloud.points.resize (cloud.width * cloud.height);

  for (size_t i = 0; i < cloud.points.size (); ++i)
  {
    cloud.points[i].x = 1024 * rand () / (RAND_MAX + 1.0f);
    cloud.points[i].y = 1024 * rand () / (RAND_MAX + 1.0f);
    cloud.points[i].z = 1024 * rand () / (RAND_MAX + 1.0f);
  }

  pcl::io::savePCDFileASCII ("test_pcd.pcd", cloud);
  std::cerr << "Saved " << cloud.points.size () << " data points to test_pcd.pcd." << std::endl;

  for (size_t i = 0; i < cloud.points.size (); ++i)
    std::cerr << "    " << cloud.points[i].x << " " << cloud.points[i].y << " " << cloud.points[i].z << std::endl;

  return (0);
}
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-03-31 06:06:25 -0500

You should set the startup project that will be launched when you click F5 in Visual Studio. By default, the startup project is ALL_BUILD. right click on the project you want in the solution explorer, and choose "set as startup project".

edit flag offensive delete link more

Comments

Thank you. It works fine.

Nihad gravatar image Nihad  ( 2013-03-31 14:47:05 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-03-30 17:01:17 -0500

Seen: 285 times

Last updated: Mar 31 '13