Ubuntu 20.04 --> build error "catkin_make -DCMAKE_BUILD_TYPE=Release"
The actual error is extremely long (can't fit all of it here) but it mostly tied with pcl. Any assistance would be greatly appreicated!
beginning of error:
[ 15%] Built target nav_msgs_generate_messages_eus
[ 16%] Building CXX object odometry_saver/CMakeFiles/odometry_saver.dir/src/odometry_saver.cpp.o
In file included from /usr/include/pcl-1.10/pcl/pcl_macros.h:77,
from /usr/include/pcl-1.10/pcl/PCLHeader.h:10,
from /usr/include/pcl-1.10/pcl/point_cloud.h:47,
from /opt/ros/noetic/include/pcl_ros/point_cloud.h:5,
from /home/mat/catkin_ws/src/odometry_saver/src/odometry_saver.cpp:12:
/usr/include/pcl-1.10/pcl/pcl_config.h:7:4: error: #error PCL requires C++14 or above
7 | #error PCL requires C++14 or above
| ^~~~~
In file included from /usr/include/pcl-1.10/pcl/console/print.h:44,
from /usr/include/pcl-1.10/pcl/conversions.h:53,
from /opt/ros/noetic/include/pcl_ros/point_cloud.h:8,
from /home/mat/catkin_ws/src/odometry_saver/src/odometry_saver.cpp:12:
/usr/include/pcl-1.10/pcl/pcl_config.h:7:4: error: #error PCL requires C++14 or above
7 | #error PCL requires C++14 or above
| ^~~~~
In file included from /opt/ros/noetic/include/pcl_ros/point_cloud.h:284,
from /home/mat/catkin_ws/src/odometry_saver/src/odometry_saver.cpp:12:
/usr/include/pcl-1.10/pcl/pcl_config.h:7:4: error: #error PCL requires C++14 or above
7 | #error PCL requires C++14 or above
| ^~~~~
^Cmake[2]: *** [odometry_saver/CMakeFiles/odometry_saver.dir/build.make:63: odometry_saver/CMakeFiles/odometry_saver.dir/src/odometry_saver.cpp.o] Interrupt
make[1]: *** [CMakeFiles/Makefile2:3004: odometry_saver/CMakeFiles/odometry_saver.dir/all] Interrupt
make: *** [Makefile:141: all] Interrupt
Traceback (most recent call last):
File "/opt/ros/noetic/bin/catkin_make", line 306, in
........................................................................................................
end of error: /usr/include/pcl-1.10/pcl/common/impl/copy_point.hpp:80:54: error: ‘enable_if_t’ is not a member of ‘std’; did you mean ‘enable_if’? 80 | struct CopyPointHelper<PointInT, PointOutT, std::enable_if_t<std::is_same<PointInT, PointOutT>::value>> | ^~~~~~~~~~~ | enable_if /usr/include/pcl-1.10/pcl/common/impl/copy_point.hpp:80:101: error: type/value mismatch at argument 3 in template parameter list for ‘template<class PointInT, class PointOutT, class Enable> struct pcl::detail::CopyPointHelper’ 80 | ntHelper<PointInT, PointOutT, std::enable_if_t<std::is_same<PointInT, PointOutT>::value>> | ^~~~~
/usr/include/pcl-1.10/pcl/common/impl/copy_point.hpp:80:101: note: expected a type, got ‘(
/usr/include/pcl-1.10/pcl/common/impl/copy_point.hpp:90:33: error: ‘enable_if_t’ is not a member of ‘std’; did you mean ‘enable_if’? 90 | std::enable_if_t<boost::mpl::and_<boost::mpl::not_<std::is_same<PointInT, PointOutT>>, | ^~~~~~~~~~~ | enable_if /usr/include/pcl-1.10/pcl/common/impl/copy_point.hpp:90:33: error: ‘enable_if_t’ is not a member of ‘std’; did you mean ‘enable_if’? 90 | std::enable_if_t<boost::mpl::and_<boost::mpl::not_<std::is_same<PointInT, PointOutT>>, | ^~~~~~~~~~~ | enable_if In file included from /usr/include/pcl-1.10/pcl/common/copy_point.h:58, from /usr/include/pcl-1.10/pcl/common/impl/io.hpp:45, from /usr/include/pcl-1.10/pcl/common/io.h:586, from /usr/include/pcl-1.10/pcl/io/file_io.h:41, from /usr/include/pcl-1.10/pcl/io/pcd_io.h:44, from /opt/ros/noetic/include/pcl_conversions/pcl_conversions.h:70, from /opt/ros/noetic/include/pcl_ros/point_cloud.h:9, from /home/mat/catkin_ws/src/odometry_saver/src/odometry_saver.cpp:12: /usr/include/pcl-1.10/pcl/common/impl/copy_point.hpp:96:152: error: type/value mismatch at argument 3 in template parameter list for ‘template<class PointInT, class PointOutT, class Enable> struct pcl::detail::CopyPointHelper’ 96 | pcl::traits::has_field<PointOutT, pcl::fields::rgba>>>>::value>> | ^~~~~
/usr/include/pcl-1.10/pcl/common/impl/copy_point.hpp:96:152: note: expected a type, got ‘(
/usr/include/pcl-1.10/pcl/common/impl/copy_point.hpp:109:33: error: ‘enable_if_t’ is not a member of ‘std’; did you mean ‘enable_if’? 109 | std::enable_if_t<boost::mpl::and_<boost::mpl::not_<std::is_same<PointInT, PointOutT>>, | ^~~~~~~~~~~ | enable_if /usr/include/pcl-1.10/pcl/common/impl/copy_point.hpp:109:33: error: ‘enable_if_t’ is not a member of ‘std’; did you mean ‘enable_if’? 109 | std::enable_if_t<boost::mpl::and_<boost::mpl::not_<std::is_same<PointInT, PointOutT>>, | ^~~~~~~~~~~ | enable_if /usr/include/pcl-1.10/pcl/common/impl/copy_point.hpp:113:134: error: type/value mismatch at argument 3 in template parameter list for ‘template<class PointInT, class PointOutT, class Enable> struct pcl::detail::CopyPointHelper’ 113 | pcl::traits::has_field<PointOutT, pcl::fields::rgb>>>>::value>> | ^~~~~
/usr/include/pcl-1.10/pcl/common/impl/copy_point.hpp:113:134: note: expected a type, got ‘(
In file included from /usr/include/pcl-1.10/pcl/common/io.h:586,
from /usr/include/pcl-1.10/pcl/io/file_io.h:41,
from /usr/include/pcl-1.10/pcl/io/pcd_io.h:44,
from /opt/ros/noetic/include/pcl_conversions/pcl_conversions.h:70,
from /opt/ros/noetic/include/pcl_ros/point_cloud.h:9,
from /home/mat/catkin_ws/src/odometry_saver/src/odometry_saver.cpp:12:
/usr/include/pcl-1.10/pcl/common/impl/io.hpp: In function ‘int pcl::getFieldIndex(const string&, const std::vectorpcl::PCLPointField&)’:
/usr/include/pcl-1.10/pcl/common/impl/io.hpp:73:27: error: use of ‘auto’ in lambda parameter declaration only available with ‘-std=c++14’ or ‘-std=gnu++14’
73 | [&field_name](const auto& field) { return field.name == field_name; });
| ^~~~
/usr/include/pcl-1.10/pcl/common/impl/io.hpp: In lambda function:
/usr/include/pcl-1.10/pcl/common/impl/io.hpp:73:55: error: request for member ‘name’ in ‘field’, which is of non-class type ‘const int’
73 | [&field_name](const auto& field) { return field.name == field_name; });
| ^~~~
/usr/include/pcl-1.10/pcl/common/impl/io.hpp: In function ‘void pcl::copyPointCloud(const pcl::PointCloud<PointT>&, const std::vectorpcl::PointIndices&, pcl::PointCloud<PointOutT>&)’:
/usr/include/pcl-1.10/pcl/common/impl/io.hpp:272:16: error: use of ‘auto’ in lambda parameter declaration only available with ‘-std=c++14’ or ‘-std=gnu++14’
272 | [](const auto& acc, const auto& index) { return index.indices.size() + acc; });
| ^~~~
/usr/include/pcl-1.10/pcl/common/impl/io.hpp:272:33: error: use of ‘auto’ in lambda parameter declaration only available with ‘-std=c++14’ or ‘-std=gnu++14’
272 | [](const auto& acc, const auto& index) { return index.indices.size() + acc; });
| ^~~~
/usr/include/pcl-1.10/pcl/common/impl/io.hpp: In lambda function:
/usr/include/pcl-1.10/pcl/common/impl/io.hpp:272:61: error: request for member ‘indices’ in ‘index’, which is of non-class type ‘const int’
272 | [](const auto& acc, const auto& index) { return index.indices.size() + acc; });
| ^~~~~~~
In file included from /usr/include/pcl-1.10/pcl/io/pcd_io.h:44,
from /opt/ros/noetic/include/pcl_conversions/pcl_conversions.h:70,
from /opt/ros/noetic/include/pcl_ros/point_cloud.h:9,
from /home/mat/catkin_ws/src/odometry_saver/src/odometry_saver.cpp:12:
/usr/include/pcl-1.10/pcl/io/file_io.h: At global scope:
/usr/include/pcl-1.10/pcl/io/file_io.h:235:8: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type; did you mean ‘enable_if’?
235 | std::enable_if_t<std::is_floating_point<Type>::value>
| ^~~~~~~~~~~
| enable_if
In file included from /usr/include/pcl-1.10/pcl/io/pcd_io.h:44,
from /opt/ros/noetic/include/pcl_conversions/pcl_conversions.h:70,
from /opt/ros/noetic/include/pcl_ros/point_cloud.h:9,
from /home/mat/catkin_ws/src/odometry_saver/src/odometry_saver.cpp:12:
/usr/include/pcl-1.10/pcl/io/file_io.h:252:8: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type; did you mean ‘enable_if’?
252 | std::enable_if_t<std::is_integral<Type>::value>
| ^~~~~~~~~~~
| enable_if
/usr/include/pcl-1.10/pcl/io/file_io.h:266:18: error: expected initializer before ‘<’ token
266 | copyValueStringstd::int8_t (const pcl::PCLPointCloud2 &cloud,
| ^
/usr/include/pcl-1.10/pcl/io/file_io.h:280:18: error: expected initializer before ‘<’ token
280 | copyValueStringstd::uint8_t (const pcl::PCLPointCloud2 &cloud,
| ^
/usr/include/pcl-1.10/pcl/io/file_io.h:304:8: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type; did you mean ‘enable_if’?
304 | std::enable_if_t<std::is_floating_point<Type>::value, bool>
| ^~~~~~~~~~~
| enable_if
/usr/include/pcl-1.10/pcl/io/file_io.h:317:8: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type; did you mean ‘enable_if’?
317 | std::enable_if_t<std::is_integral<Type>::value, bool>
| ^~~~~~~~~~~
| enable_if
In file included from /home/mat/catkin_ws/src/odometry_saver/src/odometry_saver.cpp:12:
/opt/ros/noetic/include/pcl_ros/point_cloud.h:299:27: warning: variable templates only available with ‘-std=c++14’ or ‘-std=gnu++14’
299 | constexpr static bool pcl_uses_boost = std::is_same<boost::shared_ptr<T>,
| ^~~~~~~~~~~~~~
In file included from /usr/include/c++/9/algorithm:62,
from /usr/include/eigen3/Eigen/Core:288,
from /home/mat/catkin_ws/src/odometry_saver/src/odometry_saver.cpp:5:
/usr/include/c++/9/bits/stl_algo.h: In instantiation of ‘_OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation) [with _IIter = __gnu_cxx::__normal_iterator<const pcl::Vertices*, std::vectorpcl::Vertices >; _OIter = std::back_insert_iterator<std::vectorpcl::Vertices >; _UnaryOperation = pcl::PolygonMesh::concatenate(pcl::PolygonMesh&, const pcl::PolygonMesh&)::<lambda(int)>]’:
/usr/include/pcl-1.10/pcl/PolygonMesh.h:55:24: required from here
/usr/include/c++/9/bits/stl_algo.h:4343:24: error: no match for call to ‘(pcl::PolygonMesh::concatenate(pcl::PolygonMesh&, const pcl::PolygonMesh&)::<lambda(int)>) (const pcl::Vertices&)’
4343 | __result = __unary_op(__first);
| ~~~~~~~~~~^~~~~~~~~~
In file included from /opt/ros/noetic/include/pcl_conversions/pcl_conversions.h:67,
from /opt/ros/noetic/include/pcl_ros/point_cloud.h:9,
from /home/mat/catkin_ws/src/odometry_saver/src/odometry_saver.cpp:12:
/usr/include/pcl-1.10/pcl/PolygonMesh.h:45:22: note: candidate: ‘pcl::PolygonMesh::concatenate(pcl::PolygonMesh&, const pcl::PolygonMesh&)::<lambda(int)>’
45 | [point_offset](auto polygon)
| ^
/usr/include/pcl-1.10/pcl/PolygonMesh.h:45:22: note: no known conversion for argument 1 from ‘const pcl::Vertices’ to ‘int’
In file included from /usr/include/c++/9/numeric:62,
from /usr/include/pcl-1.10/pcl/common/io.h:43,
from /usr/include/pcl-1.10/pcl/io/file_io.h:41,
from /usr/include/pcl-1.10/pcl/io/pcd_io.h:44,
from /opt/ros/noetic/include/pcl_conversions/pcl_conversions.h:70,
from /opt/ros/noetic/include/pcl_ros/point_cloud.h:9,
from /home/mat/catkin_ws/src/odometry_saver/src/odometry_saver.cpp:12:
/usr/include/c++/9/bits/stl_numeric.h: In instantiation of ‘_Tp std::accumulate(_InputIterator, _InputIterator, _Tp, _BinaryOperation) [with _InputIterator = __gnu_cxx::__normal_iterator<const pcl::PCLPointField*, std::vectorpcl::PCLPointField >; _Tp = std::__cxx11::basic_string
It seems that there are some issues about the C++ version. Can you try adding set(CMAKE_CXX_STANDARD 17) in CMakeLists.txt?
I got past the build error, thank you! I'm running into a new error when I try to launch the application. It has something to do with shader version? Any insight would be greatly appreciated, thanks!
Error: mat@mat-VirtualBox:~/catkin_ws$ rosrun interactive_slam interactive_slam error : failed to compile shader /home/mat/catkin_ws/src/interactive_slam/data/shader/rainbow.vert 0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, 1.00 ES, and 3.00 ES
error : failed to compile shader /home/mat/catkin_ws/src/interactive_slam/data/shader/rainbow.frag 0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, 1.00 ES, and 3.00 ES
error : failed to link program error: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shader construct solver: lm_var_cholmod done error : failed to compile shader /home/mat/catkin_ws/src/interactive_slam/data/shader/rainbow.vert 0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, 1.00 ES, and 3.00 ES
error : failed to compile shader /home/mat/catkin_ws/src/interactive_slam/data/shader/rainbow.frag 0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, 1.00 ES, and 3.00 ES
error : failed to link program error: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shader