对`cv :: VideoCapture :: VideoCapture(int)的未定义引用

时间:2017-08-24 17:43:13

标签: c++ eclipse opencv gcc

当我试图启动电脑摄像头时,我遇到了这个问题。 我正在使用此代码

#include "opencv2/highgui/highgui.hpp"
#include <iostream>
#include "opencv2/videoio.hpp"

using namespace cv;
using namespace std;

int main(int argc, char* argv[])
{
    VideoCapture cap(0); // open the video camera no. 0

}

并显示此错误

enter code here
make all 
Building target: video
Invoking: GCC C++ Linker
g++ -L/usr/local/lib -o "video"  ./yes.o   -lopencv_video
./yes.o: In function `main':
/home/allofthepower/eclipse-workspace/video/Debug/../yes.cpp:10: undefined reference to `cv::VideoCapture::VideoCapture(int)'
makefile:44: recipe for target 'video' failed
/home/allofthepower/eclipse-workspace/video/Debug/../yes.cpp:10: undefined reference to `cv::VideoCapture::~VideoCapture()'
collect2: error: ld returned 1 exit status
make: *** [video] Error 1

我是Ubuntu和OpenCV的新手,请帮助。

0 个答案:

没有答案