PointCloudLibrary / pcl

Point Cloud Library (PCL)
https://pointclouds.org/
Other
10.04k stars 4.62k forks source link

[compile error] "Please help me。 What should I do?" #4459

Closed xinzhichao closed 3 years ago

xinzhichao commented 4 years ago

[ 0%] Built target pcl_io_ply [ 0%] Built target pcl_people [ 0%] Built target pcl_pcd_convert_NaN_nan [ 0%] Built target pcl_plyheader [ 1%] Built target pcl_ply2raw [ 1%] Built target pcl_ply2ply [ 2%] Built target pcl_ply2obj [ 5%] Built target pcl_common [ 6%] Built target pcl_kdtree [ 7%] Built target pcl_octree [ 9%] Built target pcl_ml [ 11%] Built target pcl_stereo [ 12%] Built target pcl_search [ 12%] Building CXX object sample_consensus/CMakeFiles/pcl_sample_consensus.dir/src/sac_model_circle3d.cpp.o [ 21%] Built target pcl_io [ 21%] Built target pcl_openni_grabber_example [ 21%] Built target pcl_pcd_introduce_nan [ 21%] Built target pcl_hdl_grabber [ 21%] Built target pcl_convert_pcd_ascii_binary [ 22%] Built target pcl_openni_grabber_depth_example [ 23%] Built target pcl_converter [ 27%] Built target pcl_surface [ 27%] Built target pcl_pcd2vtk [ 28%] Built target pcl_openni_pcd_recorder [ 29%] Built target pcl_vtk2pcd [ 29%] Built target pcl_add_gaussian_noise [ 30%] Built target pcl_compute_cloud_error [ 31%] Built target pcl_pclzf2pcd [ 32%] Built target pcl_png2pcd [ 32%] Built target pcl_ply2pcd [ 33%] Built target pcl_pcd2ply [ 34%] Built target pcl_xyz2pcd [ 35%] Built target pcl_demean_cloud [ 35%] Built target pcl_ply2vtk [ 35%] Built target pcl_concatenate_points_pcd [ 35%] Built target pcl_compute_hausdorff [ 36%] Built target pcl_pcd_change_viewpoint [ 36%] Built target pcl_vtk2obj [ 36%] Built target pcl_oni2pcd [ 36%] Built target pcl_pcd2png [ 37%] Built target pcl_compute_hull [ 41%] Built target pcl_visualization [ 42%] Built target pcl_obj2vtk [ 43%] Built target pcl_tiff2pcd [ 43%] Built target pcl_vtk2ply [ 43%] Built target pcl_generate [ 43%] Built target pcl_obj2ply [ 43%] Built target pcl_obj2pcd [ 44%] Built target pcl_outofcore [ 45%] Built target pcl_oni_viewer [ 45%] Built target pcl_image_grabber_saver [ 45%] Built target pcl_vlp_viewer [ 45%] Built target pcl_openni_save_image [ 46%] Built target pcl_hdl_viewer_simple [ 46%] Built target pcl_openni_viewer [ 47%] Built target pcl_pcd_image_viewer [ 47%] Built target pcl_viewer [ 47%] Built target pcl_image_grabber_viewer [ 47%] Built target pcl_timed_trigger_test [ 47%] Built target pcl_openni_image [ 47%] Built target pcl_gp3_surface [ 47%] Built target pcl_marching_cubes_reconstruction [ 47%] Built target pcl_poisson_reconstruction [ 47%] Built target pcl_pcd_grabber_viewer [ 47%] Built target pcl_openni2_viewer In file included from /home/xinzhichao/download/pcl-pcl-1.11.1/sample_consensus/src/sac_model_circle3d.cpp:38: /home/xinzhichao/download/pcl-pcl-1.11.1/sample_consensus/include/pcl/sample_consensus/impl/sac_model_circle3d.hpp: In member function ‘void pcl::SampleConsensusModelCircle3D::optimizeModelCoefficients(const Indices&, const VectorXf&, Eigen::VectorXf&) const’: /home/xinzhichao/download/pcl-pcl-1.11.1/sample_consensus/include/pcl/sample_consensus/impl/sac_model_circle3d.hpp:281:15: error: ‘Index’ is not a member of ‘Eigen’ 281 | for (Eigen::Index i = 0; i < coeff.size (); ++i) | ^~~~~ /home/xinzhichao/download/pcl-pcl-1.11.1/sample_consensus/include/pcl/sample_consensus/impl/sac_model_circle3d.hpp:281:28: error: ‘i’ was not declared in this scope 281 | for (Eigen::Index i = 0; i < coeff.size (); ++i) | ^ make[2]: [sample_consensus/CMakeFiles/pcl_sample_consensus.dir/build.make:109:sample_consensus/CMakeFiles/pcl_sample_consensus.dir/src/sac_model_circle3d.cpp.o] error 1 make[1]: [CMakeFiles/Makefile2:1191:sample_consensus/CMakeFiles/pcl_sample_consensus.dir/all] error 2 make: *** [Makefile:172:all] error 2

mvieth commented 4 years ago
xinzhichao commented 4 years ago
  • What operating system do you use?
  • What Eigen version do you have installed (and how)?

hello,my system is ubuntu 20.0.4. Eigen version is 3.1.0,install by source code.

mvieth commented 4 years ago

May I ask why you installed Eigen by source, and not with apt? The apt Eigen version is 3.3.7. It is possible that Eigen::Index is not present in Eigen 3.1.0 (not sure), that version is quite old anyways.

stale[bot] commented 3 years ago

Marking this as stale due to 30 days of inactivity. It will be closed in 7 days if no further activity occurs.

y9luiz commented 3 years ago

Add this line to

pcl/sample_consensus/impl/sac_model_circle3d.hpp

typedef EIGEN_DEFAULT_DENSE_INDEX_TYPE Index;

And be happy :)

In my case I added it on the top of the file, so...


#ifndef PCL_SAMPLE_CONSENSUS_IMPL_SAC_MODEL_CIRCLE_3D_HPP_
#define PCL_SAMPLE_CONSENSUS_IMPL_SAC_MODEL_CIRCLE_3D_HPP_

#include <pcl/sample_consensus/eigen.h>
#include <pcl/sample_consensus/sac_model_circle3d.h>
#include <pcl/common/concatenate.h>

//////////////////////////////////////////////////////////////////////////
typedef EIGEN_DEFAULT_DENSE_INDEX_TYPE Index;
template <typename PointT> bool
pcl::SampleConsensusModelCircle3D<PointT>::isSampleGood (
    const std::vector<int> &samples) const
{
.
.
.
jimmyshe commented 2 years ago

deleted