在使用opencv和x11时,需要使用头文件:
opencv.hpp 和 X11/Xlib.h
当X11的头文件在opencv的头文件之前时,会产生错误:
stitching
.hpp
:136:10: 错误:expected identifier before ‘
int’
enum Status
stitching
.hpp
:137:5: 错误:expected unqualified
-id before ‘
{’ token
{
解决方法:将opencv头文件放在X11之前
#include <opencv2/opencv.hpp>
#include <X11/Xlib.h>
参考:https://github.com/opencv/opencv/issues/7113#issuecomment-239964226