Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Program crash because of OpenCV



  • I'm trying to do some stuff with opencv for the first time, followed all steps from the official manual, program have no errors, compiles well, and it eventually crashes when i press "Run".

    The line which cause this crash is simple, and it is the only OpenCV stuff in the code:

    cv::Mat sourceIMG;
    

    Here is part of my .pro file:
    alt text

    And this is includes, app output and deploy info:
    alt text

    Build environment which i added yesterday for includes, and now added .dlls for hope that it would help but it did'nt:
    alt text

    It is probably somthing wrong with opencv dll's, but i'm not sure, please help.



  • This topic helped, i checked my system variables and found that manual which i used for installing OpenCV mislead me, i added wrong folder(for x64 version) when i was aiming x32 OpenCV.

    Changed System variable path for OpenCV dlls to "D:\Program Files\opencv\build\install\x86\vc15\bin" , now no crash, program works correctly.



  • Ah, and i also can't debug it for some reason. When i try(Ctrl+F5) it simply gives me message-box(error) "The CDB process terminated"


  • Moderators

    @Engelard what compiler are you using in your qt build, I can't really tell from "MSVC_for_32" ;)



  • @J-Hilk how to what compiler exactly my project uses right now?
    alt text
    some of those i suppose.



  • @Engelard
    I'm thinking the 15.0 (x86) one would be best for your situation.



  • @JonB as i understand exactly that is used by my project right now:
    alt text
    And again, everything compiles well, it crashes at runtime because of that OpenCV line..



  • @Engelard
    Just because it compiles/links does not mean all is well, per se. Your line creates a runtime OpenCV object, any incompatibility could show up at that point. Not that I have the answer for you, but just saying....

    BTW, is that line a global/static variable, a member variable, or what? I know nothing about OpenCV, does it have a library initialization call you are supposed to make before creating any objects?

    When i try(Ctrl+F5) it simply gives me message-box(error) "The CDB process terminated"

    Have you tried a one-line, Hello World program, no Qt or OpenCV, just to check your compiler set up etc. is working OK?



  • @JonB said in Program crash because of OpenCV:

    BTW, is that line a global/static variable, a member variable, or what?

    Simple object declaration



  • @JonB said in Program crash because of OpenCV:

    Have you tried a one-line, Hello World program, no Qt or OpenCV, just to check your compiler set up etc. is working OK?

    As i said at the beginning, if i removing that exact line(cv::Mat sourceIMG;) - everything works well



  • This topic helped, i checked my system variables and found that manual which i used for installing OpenCV mislead me, i added wrong folder(for x64 version) when i was aiming x32 OpenCV.

    Changed System variable path for OpenCV dlls to "D:\Program Files\opencv\build\install\x86\vc15\bin" , now no crash, program works correctly.


Log in to reply