Linking error: undefined reference to `cv::VideoCa

2019-09-08 08:51发布

问题:

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&)'

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

Edit: 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?

Edit: OpenCV version: 2.4.9 (cloned from git yesterday).

回答1:

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