opencv 错误:stitching.hpp:136:10: 错误:expected identifier before ‘int’ enum Status

  • Post author:
  • Post category:其他


在使用opencv和x11时,需要使用头文件:

opencv.hpp 和 X11/Xlib.h

当X11的头文件在opencv的头文件之前时,会产生错误:

stitching.hpp:136:10: 错误:expected identifier before ‘intenum 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



版权声明:本文为Eric_Fisher原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。