laboshinl / loam_velodyne

Laser Odometry and Mapping (Loam) is a realtime method for state estimation and mapping using a 3D lidar.
http://wiki.ros.org/loam_velodyne
Other
1.71k stars 955 forks source link

Build error: flann error? #168

Open Long1988X opened 2 years ago

Long1988X commented 2 years ago

Build infos as follows, could u give me some advices, thanks! In file included from /usr/include/flann/util/params.h:33:0, from /usr/include/pcl/kdtree/kdtree_flann.h:44, from /usr/include/pcl/search/kdtree.h:43, from /usr/include/pcl/search/pcl_search.h:43, from /usr/include/pcl/filters/statistical_outlier_removal.h:43, from /home/pikachu/My_test/ws_loam_livox/src/loam_livox/source/laser_mapping.hpp:49, from /home/pikachu/My_test/ws_loam_livox/src/loam_livox/source/laser_mapping.cpp:37: /usr/include/flann/util/params.h:44:1: error: ‘flann_algorithm_t’ was not declared in this scope SMALL_POLICY(flann_algorithm_t); ^ /usr/include/flann/util/params.h:44:1: error: template argument 1 is invalid SMALL_POLICY(flann_algorithm_t); ^ /usr/include/flann/util/params.h:45:1: error: ‘flann_centers_init_t’ was not declared in this scope SMALL_POLICY(flann_centers_init_t); ^ /usr/include/flann/util/params.h:45:1: error: template argument 1 is invalid SMALL_POLICY(flann_centers_init_t); ^ /usr/include/flann/util/params.h:46:1: error: ‘flann_log_level_t’ was not declared in this scope SMALL_POLICY(flann_log_level_t); ^ /usr/include/flann/util/params.h:46:1: error: template argument 1 is invalid SMALL_POLICY(flann_log_level_t); ^ /usr/include/flann/util/params.h:47:1: error: ‘flann_datatype_t’ was not declared in this scope SMALL_POLICY(flann_datatype_t); ^ /usr/include/flann/util/params.h:47:1: error: template argument 1 is invalid SMALL_POLICY(flann_datatype_t); ^ In file included from /usr/include/pcl/kdtree/kdtree_flann.h:44:0, from /usr/include/pcl/search/kdtree.h:43, from /usr/include/pcl/search/pcl_search.h:43, from /usr/include/pcl/filters/statistical_outlier_removal.h:43, from /home/pikachu/My_test/ws_loam_livox/src/loam_livox/source/laser_mapping.hpp:49, from /home/pikachu/My_test/ws_loam_livox/src/loam_livox/source/laser_mapping.cpp:37: /usr/include/flann/util/params.h: In function ‘T flann::get_param(const IndexParams&, std::__cxx11::string)’: /usr/include/flann/util/params.h:114:15: error: there are no arguments to ‘FLANNException’ that depend on a template parameter, so a declaration of ‘FLANNException’ must be available [-fpermissive] throw FLANNException(std::string("Missing parameter '")+name+std::string("' in the parameters given")); ^~~~~~ /usr/include/flann/util/params.h:114:15: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated) In file included from /usr/include/flann/util/params.h:33:0, from /usr/include/pcl/kdtree/kdtree_flann.h:44, from /home/pikachu/My_test/ws_loam_livox/src/loam_livox/source/livox_feature_extractor.hpp:54, from /home/pikachu/My_test/ws_loam_livox/src/loam_livox/source/laser_feature_extractor.hpp:57, from /home/pikachu/My_test/ws_loam_livox/src/loam_livox/source/laser_feature_extractor.cpp:37: /usr/include/flann/util/params.h:44:1: error: ‘flann_algorithm_t’ was not declared in this scope SMALL_POLICY(flann_algorithm_t); ^ /usr/include/flann/util/params.h:44:1: error: template argument 1 is invalid SMALL_POLICY(flann_algorithm_t); ^ /usr/include/flann/util/params.h:45:1: error: ‘flann_centers_init_t’ was not declared in this scope SMALL_POLICY(flann_centers_init_t); ^ /usr/include/flann/util/params.h:45:1: error: template argument 1 is invalid SMALL_POLICY(flann_centers_init_t); ^ /usr/include/flann/util/params.h:46:1: error: ‘flann_log_level_t’ was not declared in this scope SMALL_POLICY(flann_log_level_t); ^ /usr/include/flann/util/params.h:46:1: error: template argument 1 is invalid SMALL_POLICY(flann_log_level_t); ^ /usr/include/flann/util/params.h:47:1: error: ‘flann_datatype_t’ was not declared in this scope SMALL_POLICY(flann_datatype_t); ^ /usr/include/flann/util/params.h:47:1: error: template argument 1 is invalid SMALL_POLICY(flann_datatype_t); ^ In file included from /usr/include/pcl/kdtree/kdtree_flann.h:44:0, from /home/pikachu/My_test/ws_loam_livox/src/loam_livox/source/livox_feature_extractor.hpp:54, from /home/pikachu/My_test/ws_loam_livox/src/loam_livox/source/laser_feature_extractor.hpp:57, from /home/pikachu/My_test/ws_loam_livox/src/loam_livox/source/laser_feature_extractor.cpp:37: /usr/include/flann/util/params.h: In function ‘T flann::get_param(const IndexParams&, std::__cxx11::string)’: /usr/include/flann/util/params.h:114:15: error: there are no arguments to ‘FLANNException’ that depend on a template parameter, so a declaration of ‘FLANNException’ must be available [-fpermissive] throw FLANNException(std::string("Missing parameter '")+name+std::string("' in the parameters given"));

AscaFAce commented 1 year ago

with add set(FLANN_INCLUDE /usr/include/flann) in the CMakeLists.txt