[Solved] Linking error: undefined reference to `cv::VideoCapture::open(std::string const&)` [closed]
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).
opencv version ?
@berak Newest from git: 2.4.9.
hmm, that's
CV_WRAP virtual bool open(const String& filename);
here (2.4.9, pulled a week ago)note: cv::String instead of std::string
@berak
cv::String x("V:/DATA/320.AVI"); capture.open(x);
instead ofcapture.open("V:/DATA/320.AVI");
renders the same error...cv::String
isstd::string
.cv::String != std::string ( core/cvstd.hpp L 230 )
i'm puzzled, where the std:string comes from
any chance, you got older(2.4.x) libs lying around ?
@berak Oh, dear God. I'm using headers from 2.4.5... But where are the headers from 2.4.9? I used CMake to compile it.
hehe, good to hear that.
if you ran the INSTALL project, they should be in build/include, or maybe in build/install/include
@berak Ok, I've run
make install
, for some reason it also rebuilded some part of it... But it works. Thank you! Next problem is thatcapture >> frame;
causes the program to crash... but at least it starts. ;pcheck cap.isOpened() before.
and, maybe edit the title of this question, and add [Solved] ?