1. OpenCV 4.x+ requires enabled C++11 support错误
/usr/include/opencv4/opencv2/core/cvdef.h:690:4: error: #error "OpenCV 4.x+ requires enabled C++11 support"
# error "OpenCV 4.x+ requires enabled C++11 support"
^~~~~
compilation terminated due to -Wfatal-errors.
opencv4需要用c++11的标准进行编译,不过在yolo程序中加入c++11标准也无效,例如在CMakelists.txt中加入
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
或者
set(CMAKE_CXX_STANDARD 14)
注意,都无效。
因此考虑需要在编译opencv4时带入c++11的标准才可以(xavier自带opencv的版本),后续再碰到就再尝试处理
2. include highgui.h 文件错误
fatal error: highgui.h: No such file or directory
#include "highgui.h"
^~~~~~~~~~~
compilation terminated.
在opencv4中,highgui.h已不存在,需要改为类似如下的文件:
#include <opencv4/opencv2/highgui/highgui_c.h>