Issue when compiling ROS noetic from source on RaspberryPi
I have been attempting to compile ROS noetic on a Raspberry Pi 4 running Buster. I have been following the instructions given here:
At the point in the compile where it starts to build xmlrpcpp.dir/src I start to see several errors and this annotation:
[ 8%] Building CXX object CMakeFiles/xmlrpcpp.dir/src/XmlRpcValue.cpp.o
In file included from /usr/include/c++/5/mutex:35:0,
from /home/pi/catkin_ws/src/ros_comm/xmlrpcpp/src/XmlRpcValue.cpp:17:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support \
There are also some other reported errors that I am unsure if related to the above.
/home/pi/catkin_ws/src/ros_comm/xmlrpcpp/src/XmlRpcValue.cpp: In member function 'std::ostream& XmlRpc::XmlRpcValue::write(std::ostream&) const':
/home/pi/catkin_ws/src/ros_comm/xmlrpcpp/src/XmlRpcValue.cpp:619:23: error: 'once_flag' in namespace 'std' does not name a type
static std::once_flag once;
^
/home/pi/catkin_ws/src/ros_comm/xmlrpcpp/src/XmlRpcValue.cpp:624:13: error: 'call_once' is not a member of 'std'
There is no obvious CmakeList.txt file. In which file should I, and how do I, enable the '-std=c++11 or -std=gnu++11 compiler options' for this build unit?
Thanks
Asked by James NT on 2021-11-06 10:04:17 UTC
Answers
This error is most likely caused by incompatibility in C++ libraries and the compiler. Don't be surprised if you fix this error more errors will pop up in the compilation process.
If you want to run ROS Noetic
with RPi 4, the best recommended way is to use Ubuntu 20.04: https://ubuntu.com/download/raspberry-pi. The installation is straightforward and you will more resources for support.
If you want to continue troubleshooting for this error, I suggest to look of what may cause: error: 'once_flag' in namespace 'std' does not name a type
Asked by osilva on 2021-11-06 14:13:13 UTC
Comments
I'm not sure this isn't an xy-problem (and other problems would turn up later on), but you could force C++11 in all packages using
catkin_make --cmake-args -DCMAKE_CXX_STANDARD=11
.Asked by gvdhoorn on 2021-11-06 14:15:44 UTC