X is not a member of 'cv'异常解决

一、X is not a member of 'cv'异常情况举例

1、实例一

//
'resize' is not a member of 'cv'
'cvtColor' is not a member of 'cv'
'putText' is not a member of 'cv'
'rectangle' is not a member of 'cv'
//

2、实例二

//
VideoTest.cpp:(.text+0x6f): undefined reference to `cv::VideoWriter::fourcc(char,char,char, char)'
VideoTest.cpp:(.text+0xc3): undefined reference to `cv::VideoWriter::open(cv::String const&, int, double, cv::Size_<int>, bool)'
VideoTest.cpp:(.text+0x103): undefined reference to `cv::namedWindow(cv::String const&, int)'
VideoTest.cpp:(.text+0x146): undefined reference to `cv::VideoCapture::read(cv::_OutputArray const&)'
VideoTest.cpp:(.text+0x1b1): undefined reference to `cv::imshow(cv::String const&, cv::_InputArray const&)'
//


二、解决办法

1、加上对应的头文件。


三、情况例举

1、实例一直接加上下面的头文件

//
#include "opencv2/imgproc/imgproc.hpp"
//

2、实例二直接加上下面的头文件

//
#include "opencv2/videoio.hpp"
//


致谢

1、 X is not a member of 'cv'异常解决

2、OpenCV resize is not a member of cv (OpenCV Basics)





展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 技术黑板 设计师: CSDN官方博客
应支付0元
点击重新获取
扫码支付

支付成功即可阅读