【发布时间】:2018-02-02 16:59:45
【问题描述】:
我在尝试启动计算机摄像头时遇到了这个问题。 我正在使用此代码
#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 的新手,请帮忙。
【问题讨论】:
-
opencv 安装在哪里?
-
它安装在这里-L/usr/local