无法使用opencv库访问我的网络摄像头

时间:2013-07-31 18:46:58

标签: qt opencv camera webcam

我正在尝试使用OpenCv库使用我的网络摄像头(在Qt中)。我收到此代码的错误:

#include "mainwindow.h"
#include <QApplication>
#include <QLabel>
#include <opencv2/opencv.hpp>
#include <opencv/cv.h>
#include <QtWidgets>
#include <QImage>

int main(int argc, char *argv[])
{
   cv::VideoCapture camera;
   camera.open(1);
}

/home/darshan/AindraDesktopApp/main.cpp:27: error: undefined reference to  `cv::VideoCapture::VideoCapture()'
/home/darshan/AindraDesktopApp/main.cpp:28: error: undefined reference to `cv::VideoCapture::open(int)'
/home/darshan/AindraDesktopApp/main.cpp:30: error: undefined reference to `cv::VideoCapture::~VideoCapture()'
/home/darshan/AindraDesktopApp/main.cpp:30: error: undefined reference to `cv::VideoCapture::~VideoCapture()'
collect2: error: collect2: error: ld returned 1 exit status

我该怎么办?

0 个答案:

没有答案