ros-industrial / ros_canopen

CANopen driver framework for ROS (http://wiki.ros.org/ros_canopen)
GNU Lesser General Public License v3.0
340 stars 272 forks source link

use default C++ standard instead of 14 #483

Closed lucasw closed 5 months ago

lucasw commented 8 months ago

I get this when trying to compile in Ubuntu 22.04:

.../src/drivers/ros_canopen/socketcan_bridge/src/socketcan_to_topic.cpp:28:
/usr/include/log4cxx/boost-std-configuration.h:10:18: error: ‘shared_mutex’ in namespace ‘std’ does not name a type
    10 |     typedef std::shared_mutex shared_mutex;
       |                  ^~~~~~~~~~~~
 /usr/include/log4cxx/boost-std-configuration.h:10:13: note: ‘std::shared_mutex’ is only available from C++17 onwards
    10 |     typedef std::shared_mutex shared_mutex;
       |             ^~~
make[2]: *** [CMakeFiles/socketcan_to_topic.dir/build.make:90: CMakeFiles/socketcan_to_topic.dir/src/socketcan_to_topic.cpp.o] 

Using the default 22.04 C++ standard (17 I think) fixes it.

This would more accurately be part of a noetic branch which would mean the default C++ standard is already 14.

mathias-luedtke commented 5 months ago

https://www.ros.org/reps/rep-0003.html#c already defines C++14 as the default for melodic