0

I installed Qt to drive D. The bad idea was that? Now I just can not connect with the OpenCV Qt. I use the compiler MSVC2015_64bit. I have registered in the path environment variable to the opencv:
"C: \ Program Files \ opencv \ build \ x64 \ vc14".
Tried to CMake generate through. But on sites only write about mingw32. Then he threw CMake and decided to write this in the .pro file:

INCLUDEPATH += C:/Program Files/opencv/build/include
CONFIG(debug, debug|release){
LIBS += "C:/Program Files/opencv/build/x64/vc14/lib/opencv_world310d.lib"
}

CONFIG(debug, debug|release){
LIBS += "C:/Program Files/opencv/build/x64/vc14/lib/opencv_world310.lib"
}

Anyway qt gives error 1083 and writes "No such file or directory".
What should I do? I want to write a 64 bit program

Himanshu
  • 4,327
  • 16
  • 31
  • 39
  • ***The bad idea was that?*** Should not matter. At work I have around 6 versions of Qt installed on X: (one for each compiler also 32 / 64 bit) – drescherjm Dec 19 '16 at 22:42
  • ***But on sites only write about mingw32*** `CMake` instructions should be very similar regardless of the compiler you use. – drescherjm Dec 19 '16 at 22:44
  • ***INCLUDEPATH += C:/Program Files/opencv/build/include*** Does that need quoted? – drescherjm Dec 19 '16 at 22:45
  • Also it looks like you are not correctly handling release / debug libs. – drescherjm Dec 19 '16 at 22:46
  • http://stackoverflow.com/questions/40452384/qt-creator-has-error-locating-opencv-sub-headers-within-headers/40824163#40824163 – agent_bean Dec 19 '16 at 23:54

2 Answers2

2

I ran into the same issue, but on MSVC 2013 Professional. After hours of hunting I found the solution. The steps listed below are found in the Qt5 documentation: [http://doc.qt.io/qtcreator/creator-project-qmake-libraries.html][1] under the "To Add Library" section.

  1. Right click on the project file located in the 'project pane' on the left side of the creator... and select "Add Library..."
  2. Follow the instructions of the wizard

Let me add some specificity from here...

  1. Select "External Library"
  2. For the "Library File" navigate to your opencv_worldXXX.lib file (or opencv_worldXXXd.lib file, you will notice that by specifying only one or the other the wizard has a checkbox which includes the other automatically) [ex. ...\opencv\build\x64\vc12\lib\opncv_world.lib]
  3. For the "Include Folder" navigate to the "include" folder within the build. [ex. ...\opencv\build\include]
  4. Select your operating system, dynamic/static library (whichever is appropriate)
  5. Hit NEXT, CLEAN UP, and RUN!
0

The main problem you have maybe that you extracted OpenCV into the program files rather than adding it to C drive directly. There is a weird problem where Qt gives an error if there are spaces in the file directory.