Help help with linking... in linux

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Help help with linking... in linux

Desta
I installed pcl on my ubuntu operating system today! I installed the pre-compiled one!

My compiler is eclipse

I started with simple example given below, but have problem

#include <iostream>
#include <iostream>
#include <pcl/point_types.h>
#include <pcl/filters/passthrough.h>

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

  // Fill in the cloud data
  cloud->width  = 5;
  cloud->height = 1;
  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);
  }

  std::cerr << "Cloud before filtering: " << 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;

  // Create the filtering object
  pcl::PassThrough<pcl::PointXYZ> pass;
  pass.setInputCloud (cloud);
  pass.setFilterFieldName ("z");
  pass.setFilterLimits (0.0, 1.0);
  //pass.setFilterLimitsNegative (true);
  pass.filter (*cloud_filtered);

  std::cerr << "Cloud after filtering: " << std::endl;
  for (size_t i = 0; i < cloud_filtered->points.size (); ++i)
    std::cerr << "    " << cloud_filtered->points[i].x << " "
                        << cloud_filtered->points[i].y << " "
                        << cloud_filtered->points[i].z << std::endl;

  return (0);
}


Here below error message





**** Build of configuration Debug for project Start ****

make all
Building file: ../src/Start.cpp
Invoking: GCC C++ Compiler
g++ -I/usr/include/pcl-1.7 -I/usr/include/flann -I/usr/include/eigen3 -I/usr/include/boost -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/Start.d" -MT"src/Start.d" -o "src/Start.o" "../src/Start.cpp"
Finished building: ../src/Start.cpp
 
Building target: Start
Invoking: GCC C++ Linker
g++ -L/usr/lib -L/lib -o "Start"  ./src/Start.o  
./src/Start.o: In function `pcl::Filter<pcl::PointXYZ>::filter(pcl::PointCloud<pcl::PointXYZ>&)':
/usr/include/pcl-1.7/pcl/filters/filter.h:133: undefined reference to `pcl::PCLBase<pcl::PointXYZ>::initCompute()'
/usr/include/pcl-1.7/pcl/filters/filter.h:148: undefined reference to `pcl::PCLBase<pcl::PointXYZ>::deinitCompute()'
./src/Start.o: In function `Filter':
/usr/include/pcl-1.7/pcl/filters/filter.h:104: undefined reference to `pcl::PCLBase<pcl::PointXYZ>::PCLBase()'
./src/Start.o:(.rodata._ZTVN3pcl11PassThroughINS_8PointXYZEEE[vtable for pcl::PassThrough<pcl::PointXYZ>]+0x20): undefined reference to `pcl::PCLBase<pcl::PointXYZ>::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&)'
./src/Start.o:(.rodata._ZTVN3pcl11PassThroughINS_8PointXYZEEE[vtable for pcl::PassThrough<pcl::PointXYZ>]+0x28): undefined reference to `pcl::PCLBase<pcl::PointXYZ>::setIndices(boost::shared_ptr<std::vector<int, std::allocator<int> > > const&)'
./src/Start.o:(.rodata._ZTVN3pcl11PassThroughINS_8PointXYZEEE[vtable for pcl::PassThrough<pcl::PointXYZ>]+0x30): undefined reference to `pcl::PCLBase<pcl::PointXYZ>::setIndices(boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
./src/Start.o:(.rodata._ZTVN3pcl11PassThroughINS_8PointXYZEEE[vtable for pcl::PassThrough<pcl::PointXYZ>]+0x38): undefined reference to `pcl::PCLBase<pcl::PointXYZ>::setIndices(boost::shared_ptr<pcl::PointIndices const> const&)'
./src/Start.o:(.rodata._ZTVN3pcl11PassThroughINS_8PointXYZEEE[vtable for pcl::PassThrough<pcl::PointXYZ>]+0x40): undefined reference to `pcl::PCLBase<pcl::PointXYZ>::setIndices(unsigned long, unsigned long, unsigned long, unsigned long)'
./src/Start.o:(.rodata._ZTVN3pcl11PassThroughINS_8PointXYZEEE[vtable for pcl::PassThrough<pcl::PointXYZ>]+0x48): undefined reference to `pcl::PassThrough<pcl::PointXYZ>::applyFilter(pcl::PointCloud<pcl::PointXYZ>&)'
./src/Start.o:(.rodata._ZTVN3pcl13FilterIndicesINS_8PointXYZEEE[vtable for pcl::FilterIndices<pcl::PointXYZ>]+0x20): undefined reference to `pcl::PCLBase<pcl::PointXYZ>::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&)'
./src/Start.o:(.rodata._ZTVN3pcl13FilterIndicesINS_8PointXYZEEE[vtable for pcl::FilterIndices<pcl::PointXYZ>]+0x28): undefined reference to `pcl::PCLBase<pcl::PointXYZ>::setIndices(boost::shared_ptr<std::vector<int, std::allocator<int> > > const&)'
./src/Start.o:(.rodata._ZTVN3pcl13FilterIndicesINS_8PointXYZEEE[vtable for pcl::FilterIndices<pcl::PointXYZ>]+0x30): undefined reference to `pcl::PCLBase<pcl::PointXYZ>::setIndices(boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
./src/Start.o:(.rodata._ZTVN3pcl13FilterIndicesINS_8PointXYZEEE[vtable for pcl::FilterIndices<pcl::PointXYZ>]+0x38): undefined reference to `pcl::PCLBase<pcl::PointXYZ>::setIndices(boost::shared_ptr<pcl::PointIndices const> const&)'
./src/Start.o:(.rodata._ZTVN3pcl13FilterIndicesINS_8PointXYZEEE[vtable for pcl::FilterIndices<pcl::PointXYZ>]+0x40): undefined reference to `pcl::PCLBase<pcl::PointXYZ>::setIndices(unsigned long, unsigned long, unsigned long, unsigned long)'
./src/Start.o:(.rodata._ZTVN3pcl6FilterINS_8PointXYZEEE[vtable for pcl::Filter<pcl::PointXYZ>]+0x20): undefined reference to `pcl::PCLBase<pcl::PointXYZ>::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&)'
./src/Start.o:(.rodata._ZTVN3pcl6FilterINS_8PointXYZEEE[vtable for pcl::Filter<pcl::PointXYZ>]+0x28): undefined reference to `pcl::PCLBase<pcl::PointXYZ>::setIndices(boost::shared_ptr<std::vector<int, std::allocator<int> > > const&)'
./src/Start.o:(.rodata._ZTVN3pcl6FilterINS_8PointXYZEEE[vtable for pcl::Filter<pcl::PointXYZ>]+0x30): undefined reference to `pcl::PCLBase<pcl::PointXYZ>::setIndices(boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
./src/Start.o:(.rodata._ZTVN3pcl6FilterINS_8PointXYZEEE[vtable for pcl::Filter<pcl::PointXYZ>]+0x38): undefined reference to `pcl::PCLBase<pcl::PointXYZ>::setIndices(boost::shared_ptr<pcl::PointIndices const> const&)'
./src/Start.o:(.rodata._ZTVN3pcl6FilterINS_8PointXYZEEE[vtable for pcl::Filter<pcl::PointXYZ>]+0x40): undefined reference to `pcl::PCLBase<pcl::PointXYZ>::setIndices(unsigned long, unsigned long, unsigned long, unsigned long)'
./src/Start.o:(.rodata._ZTVN3pcl7PCLBaseINS_8PointXYZEEE[vtable for pcl::PCLBase<pcl::PointXYZ>]+0x20): undefined reference to `pcl::PCLBase<pcl::PointXYZ>::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&)'
./src/Start.o:(.rodata._ZTVN3pcl7PCLBaseINS_8PointXYZEEE[vtable for pcl::PCLBase<pcl::PointXYZ>]+0x28): undefined reference to `pcl::PCLBase<pcl::PointXYZ>::setIndices(boost::shared_ptr<std::vector<int, std::allocator<int> > > const&)'
./src/Start.o:(.rodata._ZTVN3pcl7PCLBaseINS_8PointXYZEEE[vtable for pcl::PCLBase<pcl::PointXYZ>]+0x30): undefined reference to `pcl::PCLBase<pcl::PointXYZ>::setIndices(boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
./src/Start.o:(.rodata._ZTVN3pcl7PCLBaseINS_8PointXYZEEE[vtable for pcl::PCLBase<pcl::PointXYZ>]+0x38): undefined reference to `pcl::PCLBase<pcl::PointXYZ>::setIndices(boost::shared_ptr<pcl::PointIndices const> const&)'
./src/Start.o:(.rodata._ZTVN3pcl7PCLBaseINS_8PointXYZEEE[vtable for pcl::PCLBase<pcl::PointXYZ>]+0x40): undefined reference to `pcl::PCLBase<pcl::PointXYZ>::setIndices(unsigned long, unsigned long, unsigned long, unsigned long)'
./src/Start.o: In function `pcl::PassThrough<pcl::PointXYZ>::applyFilter(std::vector<int, std::allocator<int> >&)':
/usr/include/pcl-1.7/pcl/filters/passthrough.h:202: undefined reference to `pcl::PassThrough<pcl::PointXYZ>::applyFilterIndices(std::vector<int, std::allocator<int> >&)'
collect2: ld returned 1 exit status
make: *** [Start] Error 1

**** Build Finished ****






Help help please.....



Reply | Threaded
Open this post in threaded view
|

Re: Help help with linking... in linux

Sergey
Administrator
Hi Desta,

I would advise you to use CMake for configure/build your project. Check out this page.

Regards,
Sergey
Reply | Threaded
Open this post in threaded view
|

Re: Help help with linking... in linux

VictorLamoine
Administrator


2014-03-06 18:13 GMT+01:00 Sergey <[hidden email]>:
Hi Desta,

I would advise you to use CMake for configure/build your project. Check out
this page
<http://pointclouds.org/documentation/tutorials/using_pcl_pcl_config.php#using-pcl-pcl-config>
.

Regards,
Sergey



--
View this message in context: http://www.pcl-users.org/Help-help-with-linking-in-linux-tp4032748p4032749.html
Sent from the Point Cloud Library (PCL) Users mailing list mailing list archive at Nabble.com.
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users


_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Help help with linking... in linux

Desta


Thank you very much guys!

The problem was with using eclipse!

In eclipse while we define the libraries we should omit the pre and post suffix!

For example
for  libpcl_io.so
we should define only as pcl_io

This solves the problem

Thank you for your help!!