Ask Your Question

Debugging in opencv: wrong path (Win7, Codeblocks)

asked 2017-06-12 16:02:56 -0500

nji gravatar image

If I debug an application and it comes to the statement VideoCapture captRefrnc(sourceReference); in the debug output windows it says:

"warning: Error opening file (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:799)"

My question: The path


to cap_ffmpeg_impl.hpp is not correct.

The correct one is


I built opencv with CMake, Code:Blocks, mingw 4.9.2 (Win7Prof64), and don't find where the wrong path comes in ...

(I hope that with correct path I can debug into opencv to trace my bugs).

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-06-12 18:31:08 -0500

berak gravatar image

to debug opencv progs using mingw / gdb, you have to:

  • build the opencv libs in the DEBUG version (that's a whole seperate cmake && make && make install pass)
  • build your prog with -g flag, and link it against the debug libs (-lopencv_core320d , etc)

but the error is comimg from opencv_ffmpeg_64.dll, which was built on another machine, and downloaded to yours as a binary (long story about evading gpl behind that), so the build paths won't match yours ever.

edit flag offensive delete link more


Thank you again for clearing and pointing me into the direction. (Actually the option in cmake gui shows a little strange). Concerning the wrong build path by the ffmpeg binary: I don't mind if it only shows a wrong path, as long as I (a newbie) can trace/ debug what happens (And not only "Not with me, bye."). I don't know how long I can withstand the temptation of M$ VS community ed., with all these stumbling stones here ;-)

nji gravatar imagenji ( 2017-06-13 02:57:02 -0500 )edit

Question Tools

1 follower


Asked: 2017-06-12 16:02:56 -0500

Seen: 123 times

Last updated: Jun 12 '17