Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. As long as I include any opencv code, the Qt program will fail. Qt 5.1.1 & opencv 2.4.4
Forum Updated to NodeBB v4.3 + New Features

As long as I include any opencv code, the Qt program will fail. Qt 5.1.1 & opencv 2.4.4

Scheduled Pinned Locked Moved 3rd Party Software
4 Posts 2 Posters 1.8k 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.
  • B Offline
    B Offline
    breeze2014
    wrote on last edited by
    #1

    Hello, I have been trying my best to set up QT & opencv environment. Problems appear and I get over them....
    However, after the environment was probably set up finally, I came across a so so puzzling problem.

    Problem
    As long as I include any opencv code in Qt project, the program will not work.
    well, I've included the LIBS, the includepath, and the opencv bin directory.
    here is my pro file code
    !http://i.imgur.com/wubnDs6.jpg()!
    here is my main.cpp code. This works nicely.
    !http://i.imgur.com/36o44QR.jpg()!
    !http://i.imgur.com/78XkuRw.jpg()!

    if I add the opencv code 'Mat image', the program will run like this
    !http://i.imgur.com/nrPGUmN.jpg()!
    !http://i.imgur.com/AjnXYky.jpg()!

    no any information....
    no compiling errors...
    My Qt version is Qt 5.1.1+mingw 4.8 32bit
    So.....Can anybody help me with this problem?? Thanks a lot..

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      You must provide the path to your opencv dlls for your application to start. Update the PATH environment variable in the run panel for your project

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • B Offline
        B Offline
        breeze2014
        wrote on last edited by
        #3

        Thank you so much!!
        Just as you said I updated the PATH environment variable in Qt projects configuration, and the program worked good. I found a deadly mistake that Qt cannot recognize SPACE, so the directory of bin or opencv should not include any SPACE.

        I changed my PATH as the picture shows below. I hope it can help others with same problem.
        !http://i.imgur.com/FBMxPgc.jpg()!

        Finally, thank you again for your reply.
        [quote author="SGaist" date="1383341028"]Hi and welcome to devnet,

        You must provide the path to your opencv dlls for your application to start. Update the PATH environment variable in the run panel for your project[/quote]

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You're welcome !

          Spaces are not specially a problem from Qt, it's global for Windows dev tools. That's why Qt's installer put it in a path without spaces and that it's recommended that all 3rd party libraries (e.g. mysql) also be installed in path without spaces. It simplifies development a lot. You can have a look at the quote function of qmake if you have paths with spaces and ultimately there's the 8.3 notation that can be used

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

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