I've some troubles compiling opencv sample for videocapture, link here.
The following is a part of the errors I get (some involving ffmpeg). I've tried many combinations of linking and compilation flags but with no luck. Where's the problem?
g++ -pthread -o test test.cpp `pkg-config --cflags --libs opencv`
/usr/local/lib/libopencv_highgui.a(window.cpp.o): In function `cv::getWindowImageRect(cv::String const&)':
window.cpp:(.text._ZN2cv18getWindowImageRectERKNS_6StringE+0x2e): undefined reference to `cv::utils::trace::details::Region::Region(cv::utils::trace::details::Region::LocationStaticStorage const&)'
window.cpp:(.text._ZN2cv18getWindowImageRectERKNS_6StringE+0x6b): undefined reference to `cv::utils::trace::details::Region::destroy()'
window.cpp:(.text._ZN2cv18getWindowImageRectERKNS_6StringE+0x9e): undefined reference to `cv::utils::trace::details::Region::destroy()'
/usr/local/lib/libopencv_highgui.a(window.cpp.o): In function `cv::namedWindow(cv::String const&, int)':
window.cpp:(.text._ZN2cv11namedWindowERKNS_6StringEi+0x2b): undefined reference to `cv::utils::trace::details::Region::Region(cv::utils::trace::details::Region::LocationStaticStorage const&)'
window.cpp:(.text._ZN2cv11namedWindowERKNS_6StringEi+0x54): undefined reference to `cv::utils::trace::details::Region::destroy()'
window.cpp:(.text._ZN2cv11namedWindowERKNS_6StringEi+0x84): undefined reference to `cv::utils::trace::details::Region::destroy()'
/usr/local/lib/libopencv_highgui.a(window.cpp.o): In function `cv::destroyWindow(cv::String const&)':
window.cpp:(.text._ZN2cv13destroyWindowERKNS_6StringE+0x27): undefined reference to `cv::utils::trace::details::Region::Region(cv::utils::trace::details::Region::LocationStaticStorage const&)'
window.cpp:(.text._ZN2cv13destroyWindowERKNS_6StringE+0x4e): undefined reference to `cv::utils::trace::details::Region::destroy()'
window.cpp:(.text._ZN2cv13destroyWindowERKNS_6StringE+0x7c): undefined reference to `cv::utils::trace::details::Region::destroy()'
/usr/local/lib/libopencv_highgui.a(window.cpp.o): In function `cv::destroyAllWindows()':
window.cpp:(.text._ZN2cv17destroyAllWindowsEv+0x24): undefined reference to `cv::utils::trace::details::Region::Region(cv::utils::trace::details::Region::LocationStaticStorage const&)'
window.cpp:(.text._ZN2cv17destroyAllWindowsEv+0x39): undefined reference to `cv::utils::trace::details::Region::destroy()'
window.cpp:(.text._ZN2cv17destroyAllWindowsEv+0x67): undefined reference to `cv::utils::trace::details::Region::destroy()'
/usr/local/lib/libopencv_highgui.a(window.cpp.o): In function `cv::resizeWindow(cv::String const&, int, int)':
window.cpp:(.text._ZN2cv12resizeWindowERKNS_6StringEii+0x30): undefined reference to `cv::utils::trace::details::Region::Region(cv::utils::trace::details::Region::LocationStaticStorage const&)'
window.cpp:(.text._ZN2cv12resizeWindowERKNS_6StringEii+0x5c): undefined reference to `cv::utils::trace::details::Region::destroy()'
window.cpp:(.text._ZN2cv12resizeWindowERKNS_6StringEii+0x8e): undefined reference to `cv::utils::trace::details::Region::destroy()'
/usr/local/lib/libopencv_highgui.a(window.cpp.o): In function `cv::resizeWindow(cv::String const&, cv::Size_<int> const&)':
window.cpp:(.text._ZN2cv12resizeWindowERKNS_6StringERKNS_5Size_IiEE+0x2c): undefined reference to `cv::utils::trace::details::Region::Region(cv::utils::trace::details::Region::LocationStaticStorage const&)'
I've tried both:
g++ -o test test.cpp -pthread `pkg-config --cflags --libs opencv`
and
g++ -o test test.cpp `pkg-config --cflags --libs opencv` -pthread
but didn't fix.