Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Program crash because of OpenCV
Forum Updated to NodeBB v4.3 + New Features

Program crash because of OpenCV

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 3 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • EngelardE Offline
    EngelardE Offline
    Engelard
    wrote on last edited by Engelard
    #1

    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.

    1 Reply Last reply
    1
    • EngelardE Offline
      EngelardE Offline
      Engelard
      wrote on last edited by
      #10

      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.

      1 Reply Last reply
      3
      • EngelardE Offline
        EngelardE Offline
        Engelard
        wrote on last edited by Engelard
        #2

        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"

        J.HilkJ 1 Reply Last reply
        0
        • EngelardE Engelard

          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"

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #3

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


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          EngelardE 1 Reply Last reply
          0
          • J.HilkJ J.Hilk

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

            EngelardE Offline
            EngelardE Offline
            Engelard
            wrote on last edited by
            #4

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

            JonBJ 1 Reply Last reply
            0
            • EngelardE Engelard

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

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #5

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

              EngelardE 1 Reply Last reply
              0
              • JonBJ JonB

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

                EngelardE Offline
                EngelardE Offline
                Engelard
                wrote on last edited by
                #6

                @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..

                JonBJ 1 Reply Last reply
                0
                • EngelardE Engelard

                  @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..

                  JonBJ Offline
                  JonBJ Offline
                  JonB
                  wrote on last edited by JonB
                  #7

                  @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?

                  EngelardE 2 Replies Last reply
                  0
                  • JonBJ JonB

                    @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?

                    EngelardE Offline
                    EngelardE Offline
                    Engelard
                    wrote on last edited by
                    #8

                    @JonB said in Program crash because of OpenCV:

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

                    Simple object declaration

                    1 Reply Last reply
                    0
                    • JonBJ JonB

                      @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?

                      EngelardE Offline
                      EngelardE Offline
                      Engelard
                      wrote on last edited by Engelard
                      #9

                      @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

                      1 Reply Last reply
                      0
                      • EngelardE Offline
                        EngelardE Offline
                        Engelard
                        wrote on last edited by
                        #10

                        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.

                        1 Reply Last reply
                        3

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved