C++11 compatibility
Hello,
Is it possible yet to have a package in ROS compiled with c++ 11 support? Or does ROS need to be compiled from source with c++ 11? If so, is this possible?
Thanks in advance.
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
Hello,
Is it possible yet to have a package in ROS compiled with c++ 11 support? Or does ROS need to be compiled from source with c++ 11? If so, is this possible?
Thanks in advance.
I might be wrong but would like to give it a try.
Given that ROS supports only C++03 up to Hydro so far and as far as I haven't seen discussion about C++0x
support, I think your question falls into general C++
discussion. And because of possible API incompatibility, mixing compiled C++03
and C++0x
may or may not work.
UPDATE) This newer thread might answer more to your interest.
I had seen that post too, but since it was from 2011 I had hoped it would be possible by now. I added the c++0x flag and the c++11 flag but in both cases I get an error from some ros messages. Guessing it is not possible yet, but it has been out for a while now so making that step seems logical.
Nowadays it is possible.
Just add this to your CMakeLists.txt file
if(CMAKE_COMPILER_IS_GNUCXX) add_definitions(-std=gnu++0x) endif()
Be careful with the boost::shared_ptr pointers that are intensively used in ROS and but they are not compatible with std::shared_ptr
Asked: 2013-07-19 07:42:34 -0500
Seen: 3,169 times
Last updated: Apr 08 '16
roslint doesn't seem to mind CamelCased function names
Compiler error when trying to read message values
Finding buffered frames in tf2_ros::Buffer (c++)
MoveIt End effector moves correctly but reports back different orientation
How to play video from bag file in QT?
IDE for ROS (kinetic) code debugging