我正在尝试使用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
我该怎么办?