mesh_rviz_plugins
mesh_rviz_plugins copied to clipboard
Issue with PCL version vs C++ version
I am trying to build this package in Ubuntu 20.04 and it errored out with following message,
/usr/include/pcl-1.10/pcl/conversions.h:317:28: note: no known conversion for argument 1 from ‘const pcl::PCLPointField’ to ‘const int&’
In file included from /usr/include/c++/9/bits/stl_algobase.h:71,
from /usr/include/c++/9/bits/char_traits.h:39,
from /usr/include/c++/9/string:40,
from /usr/include/c++/9/stdexcept:39,
from /usr/include/c++/9/array:39,
from /usr/include/c++/9/tuple:39,
from /usr/include/c++/9/mutex:38,
from /home/bavantha/catkin_ws/src/mesh_rviz_plugins/include/mesh_rviz_plugins/textured_mesh_visual.h:25,
from /home/bavantha/catkin_ws/src/mesh_rviz_plugins/src/textured_mesh_visual.cc:22:
/usr/include/c++/9/bits/predefined_ops.h: In instantiation of ‘bool __gnu_cxx::__ops::_Iter_pred<_Predicate>::operator()(_Iterator) [with _Iterator = __gnu_cxx::__normal_iterator<const pcl::PCLPointField*, std::vector<pcl::PCLPointField> >; _Predicate = pcl::getFieldIndex(const pcl::PCLPointCloud2&, const string&)::<lambda(int)>]’:
/usr/include/c++/9/bits/stl_algo.h:120:14: required from ‘_RandomAccessIterator std::__find_if(_RandomAccessIterator, _RandomAccessIterator, _Predicate, std::random_access_iterator_tag) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<const pcl::PCLPointField*, std::vector<pcl::PCLPointField> >; _Predicate = __gnu_cxx::__ops::_Iter_pred<pcl::getFieldIndex(const pcl::PCLPointCloud2&, const string&)::<lambda(int)> >]’
/usr/include/c++/9/bits/stl_algo.h:161:23: required from ‘_Iterator std::__find_if(_Iterator, _Iterator, _Predicate) [with _Iterator = __gnu_cxx::__normal_iterator<const pcl::PCLPointField*, std::vector<pcl::PCLPointField> >; _Predicate = __gnu_cxx::__ops::_Iter_pred<pcl::getFieldIndex(const pcl::PCLPointCloud2&, const string&)::<lambda(int)> >]’
/usr/include/c++/9/bits/stl_algo.h:3969:28: required from ‘_IIter std::find_if(_IIter, _IIter, _Predicate) [with _IIter = __gnu_cxx::__normal_iterator<const pcl::PCLPointField*, std::vector<pcl::PCLPointField> >; _Predicate = pcl::getFieldIndex(const pcl::PCLPointCloud2&, const string&)::<lambda(int)>]’
/usr/include/pcl-1.10/pcl/common/io.h:65:77: required from here
/usr/include/c++/9/bits/predefined_ops.h:283:11: error: no match for call to ‘(pcl::getFieldIndex(const pcl::PCLPointCloud2&, const string&)::<lambda(int)>) (const pcl::PCLPointField&)’
283 | { return bool(_M_pred(*__it)); }
I temporarily fixed the error by adding following two lines in the project CMakeLists.txt file. Hope it helps someone.
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Yes, it did help me a lot. Thanks!