链接错误:对`cv :: VideoCapture :: open(std :: string const&)的未定义引用 [英] Linking error: undefined reference to `cv::VideoCapture::open(std::string const&)`

查看:674
本文介绍了链接错误:对`cv :: VideoCapture :: open(std :: string const&)的未定义引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用.avi文件作为源. (相机捕获已经可以使用.)我的项目编译没有问题,但是在链接过程中出现错误:

I'm trying to use an .avi file as my source. (Camera capture already works.) My project compiles without problems, but during linking I get the error:

undefined reference to 'cv::VideoCapture::open(std::string const&)'

我该怎么办? VideoCapture::open()std::string重载放在哪个库中?

What should I do? In which library is this std::string overload of VideoCapture::open() put?

VideoCapture(0)(摄像头捕获)可以编译,链接和运行,因此VideoCapture(std::string)必须位于我已经与之链接的libs中的其他位置...对吧?

VideoCapture(0) (camera capture) compiles, links and works, so VideoCapture(std::string) has to be somewhere else that in libs I'm already linking with... right?

OpenCV版本:2.4.9(昨天从git复制).

OpenCV version: 2.4.9 (cloned from git yesterday).

推荐答案

问题是由我使用2.4.9版本的2.4.5头文件引起的.

The problem was caused by me using 2.4.5 header files for 2.4.9 version.

这篇关于链接错误:对`cv :: VideoCapture :: open(std :: string const&)的未定义引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆