Results 1 to 3 of 3

Thread: error when linking opencv libraries in QT

  1. #1
    Join Date
    Mar 2020
    Posts
    4
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Windows

    Default error when linking opencv libraries in QT

    Hello, I am new using Qt, and I need to link opencv libraries in Qt for a project that includes image processing, this I already had done in linux, but when executing it in window it does not recognize opencv libraries when including them, nor when adding them is the .pro.
    When trying to compile opencv to link with Qt according to the steps shown in the url https://stackoverflow.com/questions/...use-qt-library, after step 6.3, I receive the following error in executing cmake
    CMake Error at CMakeLists.txt:18 (include):
    include could not find load file:

    cmake/OpenCVMinDepVersions.cmake


    CMake Error at CMakeLists.txt:78 (include):
    include could not find load file:

    cmake/OpenCVUtils.cmake


    CMake Error at CMakeLists.txt:79 (ocv_cmake_reset_hooks):
    Unknown CMake command "ocv_cmake_reset_hooks".


    Configuring incomplete, errors occurred!

    First it gave me the error that the CMakeLists.txt file did not exist in the opencv folder, and I added it manually as it is on the github. After doing so, when I hit the button "Configure", I received the error.
    I thank in advance who can help me to solve this problem.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: error when linking opencv libraries in QT

    The steps in the stackoverflow post you linked describe only how to install OpenCV and build it using CMake. If that is where you are having problems, make sure you have set the CMake-GUI variables described in section 6. Also be sure you have actually installed all of the OpenCV modules you are trying to build. f there are modules you don't need and have not installed, then you must set the CMake variables to ignore them. This is probably why you are having problems.

    Also, if you are NOT using gcc / g++ as a compiler but are using MSVC instead, DO NOT set the configuration for MinGW Makefiles, because the libraries will be incompatible with MSVC. You will have to choose one of the MSVC options.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. The following user says thank you to d_stranz for this useful post:

    lagarcia (19th March 2020)

  4. #3
    Join Date
    Mar 2020
    Posts
    4
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: error when linking opencv libraries in QT

    Thank you very much for your reply. First I apologize because I am not familiar with terms like gcc / g ++ and MSVC. I did exactly the same as detailed in the steps. I don't know if I installed all opencv modules, because I just gave it extract to opencv .exe. Anyway, there are few opencv functions that I will use, since the image processing for facial recognition I did with the python libraries.
    In linux I had compiled it by command and it linked perfectly to QT. If it is not too much trouble, I ask that if you have any reference where you can find the steps of how to do it in the most suitable way that you mention, I would appreciate it.

Similar Threads

  1. Replies: 0
    Last Post: 20th November 2015, 12:21
  2. Qt linking with and OpenCV
    By Zamaster in forum Qt Programming
    Replies: 4
    Last Post: 1st April 2014, 21:38
  3. Linking openCV with qt
    By harvey_slash in forum Newbie
    Replies: 4
    Last Post: 24th January 2014, 20:57
  4. linking with opencv
    By karuna in forum General Programming
    Replies: 2
    Last Post: 27th February 2013, 12:24
  5. Linking Error Qt OpenCV
    By Songi in forum Installation and Deployment
    Replies: 4
    Last Post: 28th August 2011, 05:03

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.