0

我正在尝试使用 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

我应该怎么办?

4

0 回答 0