OpenCV not working correctly in Qt debug mode

China☆狼群 提交于 2019-12-25 02:26:06

问题


I am working with OpenCV 2.4.9 under Windows 8.1 x64. I am trying to run basic operations like image reading, webcam streaming, etc. I've configured OpenCV to work with VS and QtCreator.

In both cases I use precompiled binaries from the x64/vc12 OpenCV folder, built with the VC compiler version 12.0. In Visual Studio everything works great in both release and debug modes, but in Qt Creator only release mode works correctly while in debug mode I encounter strange bugs like: wrong windows titles, imread not working correctly, bad video streaming.

In Qt Creator I use the same compiler as in VS, namely vc12. I've setup the library paths correctly and am using debug version of libs for debug and appropriate ones for release. The problems only arise when I am using C++ API in OpenCV, everything works fine if I am using the C API.

I've seen problems like mine arise regularly one, two, three, but none of those solutions solve my problem.

UPDATE: Problem solved, see the answer below.


回答1:


Problem solved!

It was in the Qt Creator's qmake, it did not correctly update the Makefile that it generates. So, instead of debug versions of the libraries, the release versions were used, but the .pro file in the project showed just the opposite.



来源:https://stackoverflow.com/questions/24852639/opencv-not-working-correctly-in-qt-debug-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!