mrpt-ros-pkg / mrpt_slam

ROS wrappers for SLAM algorithms in MRPT
http://wiki.ros.org/mrpt_slam
BSD 3-Clause "New" or "Revised" License
114 stars 49 forks source link

error: ‘enable_if_t’ in namespace ‘std’ does not name a template type #28

Closed Magnusgaertner closed 7 years ago

Magnusgaertner commented 7 years ago

Am I simply missing a compiler flag? catkin build output:

In file included from /usr/local/include/mrpt/base/include/mrpt/utils/CConfigFile.h:13:0,
                 from /home/magnus/catkin_ws/src/mrpt_slam/mrpt_ekf_slam_2d/include/mrpt_ekf_slam_2d/mrpt_ekf_slam_2d.h:10,
                 from /home/magnus/catkin_ws/src/mrpt_slam/mrpt_ekf_slam_2d/src/mrpt_ekf_slam_2d.cpp:7:
/usr/local/include/mrpt/base/include/mrpt/utils/CConfigFileBase.h:80:22: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type
      typename = std::enable_if_t<std::is_enum<enum_t>::value>>
                      ^
/usr/local/include/mrpt/base/include/mrpt/utils/CConfigFileBase.h:80:33: error: expected ‘>’ before ‘<’ token
      typename = std::enable_if_t<std::is_enum<enum_t>::value>>
                                 ^
/usr/local/include/mrpt/base/include/mrpt/utils/CConfigFileBase.h:96:22: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type
      typename = std::enable_if_t<!std::is_enum<data_t>::value>>
                      ^
/usr/local/include/mrpt/base/include/mrpt/utils/CConfigFileBase.h:96:33: error: expected ‘>’ before ‘<’ token
      typename = std::enable_if_t<!std::is_enum<data_t>::value>>
                                 ^
In file included from /usr/local/include/mrpt/base/include/mrpt/utils/CFileGZInputStream.h:12:0,
                 from /home/magnus/catkin_ws/src/mrpt_slam/mrpt_ekf_slam_2d/include/mrpt_ekf_slam_2d/mrpt_ekf_slam_2d.h:11,
                 from /home/magnus/catkin_ws/src/mrpt_slam/mrpt_ekf_slam_2d/src/mrpt_ekf_slam_2d.cpp:7:
/usr/local/include/mrpt/base/include/mrpt/utils/CStream.h:253:8: error: ‘std::enable_if_t’ has not been declared
   std::enable_if_t<is_shared_ptr<T>::value>* = nullptr)
        ^

catkin config:

Profile:                     default
Extending:          [cached] /opt/ros/kinetic
Workspace:                   /home/magnus/catkin_ws

Source Space:       [exists] /home/magnus/catkin_ws/src
Log Space:          [exists] /home/magnus/catkin_ws/logs
Build Space:        [exists] /home/magnus/catkin_ws/build
Devel Space:        [exists] /home/magnus/catkin_ws/devel
Install Space:      [unused] /home/magnus/catkin_ws/install
DESTDIR:            [unused] None

Devel Space Layout:          linked
Install Space Layout:        None

Additional CMake Args:       -GEclipse CDT4 - Unix Makefiles -DCMAKE_CXX_COMPILER_ARG1=-std=c++14 -DCMAKE_BUILD_TYPE=Release
Additional Make Args:        None
Additional catkin Make Args: None
Internal Make Job Server:    True
Cache Job Environments:      False

Whitelisted Packages:        None
Blacklisted Packages:        None

Workspace configuration appears valid.
jlblancoc commented 7 years ago

It simply requires C++14. But I just realized this repo became out of synch with MRPT master, sorry for that... Please, if you have some free time, try replacing all lines like this one on all nodes to C++14 and open a PR. It should fix it...