Getting YOLO/darknet_ros working in Ubuntu 20 and ROS Noetic
Is there a way to get darknet_ros working in Ubuntu 20? So far I see it's only tested for Ubuntu 18
Many errors when trying to compile.
cd /home/ourhome/catkin_workspace/build/darknet_ros/darknet_ros && /bin/cc -DDARKNET_FILE_PATH=\"/home/ourhome/catkin_workspace/src/darknet_ros/darknet\" -DOPENCV -DROSCONSOLE_BACKEND_LOG4CXX -DROS_BUILD_SHARED_LIBS=1 -DROS_PACKAGE_NAME=\"darknet_ros\" -Ddarknet_ros_lib_EXPORTS -I/home/ourhome/catkin_workspace/src/darknet_ros/darknet/src -I/home/ourhome/catkin_workspace/src/darknet_ros/darknet/include -I/home/ourhome/catkin_workspace/src/darknet_ros/darknet_ros/include -I/include -I/home/ourhome/catkin_workspace/devel/include -I/opt/ros/noetic/include -I/opt/ros/noetic/share/xmlrpcpp/cmake/../../../include/xmlrpcpp -isystem /usr/include/opencv4 -Wall -Wno-unused-result -Wno-unknown-pragmas -Wno-unused-variable -Wfatal-errors -fPIC -O3 -DNDEBUG -fPIC -O4 -g -o CMakeFiles/darknet_ros_lib.dir/__/darknet/src/activation_layer.c.o -c /home/ourhome/catkin_workspace/src/darknet_ros/darknet/src/activation_layer.c
In file included from /usr/include/opencv4/opencv2/core/types_c.h:84,
from /usr/include/opencv4/opencv2/core/core_c.h:48,
from /usr/include/opencv4/opencv2/highgui/highgui_c.h:45,
from /home/ourhome/catkin_workspace/src/darknet_ros/darknet/include/darknet.h:25,
from /home/ourhome/catkin_workspace/src/darknet_ros/darknet/src/activations.h:3,
from /home/ourhome/catkin_workspace/src/darknet_ros/darknet/src/activation_layer.h:4,
from /home/ourhome/catkin_workspace/src/darknet_ros/darknet/src/activation_layer.c:1:
/usr/include/opencv4/opencv2/core/cvdef.h:704:4: error: #error "OpenCV 4.x+ requires enabled C++11 support"
704 | # error "OpenCV 4.x+ requires enabled C++11 support"
| ^~~~~
compilation terminated due to -Wfatal-errors.
make[2]: *** [darknet_ros/darknet_ros/CMakeFiles/darknet_ros_lib.dir/build.make:89: darknet_ros/darknet_ros/CMakeFiles/darknet_ros_lib.dir/__/darknet/src/activation_layer.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
cd /home/ourhome/catkin_workspace/build/darknet_ros/darknet_ros && /bin/cc -DDARKNET_FILE_PATH=\"/home/ourhome/catkin_workspace/src/darknet_ros/darknet\" -DOPENCV -DROSCONSOLE_BACKEND_LOG4CXX -DROS_BUILD_SHARED_LIBS=1 -DROS_PACKAGE_NAME=\"darknet_ros\" -Ddarknet_ros_lib_EXPORTS -I/home/ourhome/catkin_workspace/src/darknet_ros/darknet/src -I/home/ourhome/catkin_workspace/src/darknet_ros/darknet/include -I/home/ourhome/catkin_workspace/src/darknet_ros/darknet_ros/include -I/include -I/home/ourhome/catkin_workspace/devel/include -I/opt/ros/noetic/include -I/opt/ros/noetic/share/xmlrpcpp/cmake/../../../include/xmlrpcpp -isystem /usr/include/opencv4 -Wall -Wno-unused-result -Wno-unknown-pragmas -Wno-unused-variable -Wfatal-errors -fPIC -O3 -DNDEBUG -fPIC -O4 -g -o CMakeFiles/darknet_ros_lib.dir/src/image_interface.c.o -c /home/ourhome/catkin_workspace/src/darknet_ros/darknet_ros/src/image_interface.c
In file included from /usr/include/opencv4/opencv2/core/types_c.h:84,
from /usr/include/opencv4/opencv2/core/core_c.h:48,
from /usr/include/opencv4/opencv2/highgui/highgui_c.h:45,
from /home/ourhome/catkin_workspace/src/darknet_ros/darknet/include/darknet.h:25,
from /home/ourhome/catkin_workspace/src/darknet_ros/darknet/src/box.h:3,
from /home/ourhome/catkin_workspace/src/darknet_ros/darknet/src/image.h:9,
from /home/ourhome/catkin_workspace/src/darknet_ros/darknet_ros/include/darknet_ros/image_interface.h:12,
from /home/ourhome/catkin_workspace/src/darknet_ros/darknet_ros/src/image_interface.c:9:
/usr/include/opencv4/opencv2/core/cvdef.h:704:4: error: #error "OpenCV 4.x+ requires enabled C++11 support"
704 | # error "OpenCV 4.x+ requires enabled C++11 support"
| ^~~~~
compilation terminated due to -Wfatal-errors.