Change from C++17 to C++20 throws compiler errors
Hello, currently I using ROS melodic with C++17 and I want to update to C++20 in next time. But if I set the new version and compile again I got this error messages:
/opt/ros/melodic/include/std_msgs/Header.h:46:121: error: no class template named ‘rebind’ in ‘class std::allocator<void>’
46 | typedef std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > _frame_id_type;
in that lines of code:
inline glm::dmat4x4 transformationMatrixOfPoint(const geometry_msgs::PoseStamped &poseStamped) noexcept
{
geometry_msgs::Point p = poseStamped.pose.position; // Here is the error
return transformationMatrixOfPoint(utils::createOrientation(poseStamped.pose.orientation), {p.x, p.y, p.z});
}
I'm also not an expert in C++ so please can you help me. Why does this compiler error come because in C++17 all works. I'm using gcc-10 .
This question has a ROS 2 analog on ROS Discourse: ROS2 compatibility with C++20.
For ROS 2, this has been fixed.
For ROS 1, I haven't checked whether there are already PRs open (on
ros_comm
or similar repositories).But without someone specifically fixing this, it's not going to go away by itself.