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. Error: undefined reference to `cvReleaseImage' (opencv + Qt)
Forum Updated to NodeBB v4.3 + New Features

Error: undefined reference to `cvReleaseImage' (opencv + Qt)

Scheduled Pinned Locked Moved General and Desktop
36 Posts 6 Posters 17.5k Views 3 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #16

    What exactly are you trying to build ?

    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
    • Negar_mgN Offline
      Negar_mgN Offline
      Negar_mg
      wrote on last edited by
      #17

      I want to write a program to display an image or video from a webcam using Qt and Open CV.
      But I was not able to add Open CV to QT. When I used the following link, I encountered those errors in CMake.
      /................................................................................................
      https://wiki.qt.io/How_to_setup_Qt_and_openCV_on_Windows
      /...............................................................................................
      And when I used the link from YouTube that I sent in the first comment, I encountered those errors in Qt.

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

        From the looks of it, the OpenCV 4 you downloaded is built with Visual Studio, thus you have to use a Visual Studio build of Qt as well as mixing C++ compilers is not possible.

        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
        • Negar_mgN Offline
          Negar_mgN Offline
          Negar_mg
          wrote on last edited by
          #19

          You mean you think I can not use opencv with Qt?
          Is there no way?

          jsulmJ 1 Reply Last reply
          0
          • Negar_mgN Negar_mg

            You mean you think I can not use opencv with Qt?
            Is there no way?

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #20

            @Negar_mg said in Error: undefined reference to `cvReleaseImage' (opencv + Qt):

            You mean you think I can not use opencv with Qt?

            No, that's not what @SGaist means.
            What he means is that you can't mix binaries built with different C++ compilers.
            And because OpenCV you downloaded was built using compiler from Microsoft Visual Studio you also need Qt built with this compiler. So, simply install MSVC2017 or MSVC2019 Qt.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            2
            • Negar_mgN Offline
              Negar_mgN Offline
              Negar_mg
              wrote on last edited by
              #21

              thanks alot :)

              1 Reply Last reply
              0
              • Negar_mgN Offline
                Negar_mgN Offline
                Negar_mg
                wrote on last edited by
                #22

                If I understand correctly, there are 2 ways to solve this issue:

                1- use vc compiler in qt to compile my codes.

                Here is a link I found for that, please let me know if it is correct:

                https://stackoverflow.com/questions/47773289/debugging-in-qtcreator-using-msvc2017-compiler

                2- download and compile opencv using qt compiler, and then refering to that folder in my qt.
                Is this compiler called minWG?
                Please give me a link or instruction on how to do that.

                jsulmJ 1 Reply Last reply
                0
                • Negar_mgN Negar_mg

                  If I understand correctly, there are 2 ways to solve this issue:

                  1- use vc compiler in qt to compile my codes.

                  Here is a link I found for that, please let me know if it is correct:

                  https://stackoverflow.com/questions/47773289/debugging-in-qtcreator-using-msvc2017-compiler

                  2- download and compile opencv using qt compiler, and then refering to that folder in my qt.
                  Is this compiler called minWG?
                  Please give me a link or instruction on how to do that.

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #23

                  @Negar_mg said in Error: undefined reference to `cvReleaseImage' (opencv + Qt):

                  Is this compiler called minWG?

                  I don't know what compiler you are using. This is something you should know.

                  To use Visual Studio compiler you first need to install Visual Studio together with C++ tools. You can use the free Community edition. Then install Qt for that Visual Studio version. Then you should have a Kit in QtCreator configured to use Visual Studio compiler. The link you posted looks legit, just download more recent Qt version.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • Negar_mgN Offline
                    Negar_mgN Offline
                    Negar_mg
                    wrote on last edited by
                    #24

                    I do not need vs and i have uninstalled it
                    But i still get the error mentioned above
                    How can i install opencv on qt without visual studio?

                    jsulmJ 1 Reply Last reply
                    0
                    • Negar_mgN Negar_mg

                      I do not need vs and i have uninstalled it
                      But i still get the error mentioned above
                      How can i install opencv on qt without visual studio?

                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #25

                      @Negar_mg Build OpenCV using the compiler you're using with Qt...
                      @mrjj Already gave you a link: https://wiki.qt.io/How_to_setup_Qt_and_openCV_on_Windows
                      Also there is official OpenCV documentation for that: https://docs.opencv.org/3.4/d3/d52/tutorial_windows_install.html

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      1
                      • Negar_mgN Offline
                        Negar_mgN Offline
                        Negar_mg
                        wrote on last edited by
                        #26

                        I have followed the steps in the link you provided, but cmake step raised some errors. Its log is bellow:

                        Log:
                        {sizeof(void) = 4 on 64 bit processor. Assume 32-bit compilation mode
                        Found PythonInterp: C:/Users/test/AppData/Local/Programs/Python/Python37/python.exe (found suitable version "3.7", minimum required is "2.7")
                        CMake Warning at cmake/OpenCVDetectPython.cmake:81 (message):
                        CMake's 'find_host_package(PythonInterp 2.7)' found wrong Python version:
                        PYTHON_EXECUTABLE=C:/Users/test/AppData/Local/Programs/Python/Python37/python.exe
                        PYTHON_VERSION_STRING=3.7
                        Consider providing the 'PYTHON2_EXECUTABLE' variable via CMake command line
                        or environment variables
                        Call Stack (most recent call first):
                        cmake/OpenCVDetectPython.cmake:271 (find_python)
                        CMakeLists.txt:614 (include)
                        Could NOT find Python2 (missing: Python2_EXECUTABLE Interpreter)
                        Reason given by package:
                        Interpreter: Wrong major version for the interpreter "C:/Users/test/AppData/Local/Programs/Python/Python37/python.exe"
                        }
                        //..............................
                        {
                        Performing Test HAVE_CXX_WNO_ENUM_COMPARE_SWITCH - Failed
                        Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
                        VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
                        ADE: Download: v0.1.1f.zip
                        Try 1 failed
                        CMake Warning at cmake/OpenCVDownload.cmake:202 (message):
                        ADE: Download failed: 35;"SSL connect error"
                        For details please refer to the download log file:
                        C:/Qt/opencv_cv2/opencv/release/CMakeDownloadLog.txt
                        Call Stack (most recent call first):
                        modules/gapi/cmake/DownloadADE.cmake:5 (ocv_download)
                        modules/gapi/cmake/init.cmake:19 (include)
                        cmake/OpenCVModule.cmake:298 (include)
                        cmake/OpenCVModule.cmake:361 (_add_modules_1)
                        modules/CMakeLists.txt:7 (ocv_glob_modules)
                        OpenCV Python: during development append to PYTHONPATH: C:/Qt/opencv_cv2/opencv/release/python_loader
                        Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
                        FFMPEG: Download: opencv_videoio_ffmpeg.dll
                        Try 1 failed
                        CMake Warning at cmake/OpenCVDownload.cmake:202 (message):
                        FFMPEG: Download failed: 35;"SSL connect error"
                        For details please refer to the download log file:
                        C:/Qt/opencv_cv2/opencv/release/CMakeDownloadLog.txt
                        Call Stack (most recent call first):
                        3rdparty/ffmpeg/ffmpeg.cmake:20 (ocv_download)
                        modules/videoio/cmake/detect_ffmpeg.cmake:14 (download_win_ffmpeg)
                        modules/videoio/cmake/init.cmake:7 (include)
                        modules/videoio/cmake/init.cmake:18 (add_backend)
                        cmake/OpenCVModule.cmake:298 (include)
                        cmake/OpenCVModule.cmake:361 (_add_modules_1)
                        modules/CMakeLists.txt:7 (ocv_glob_modules)
                        FFMPEG: Download: opencv_videoio_ffmpeg_64.dll
                        Try 1 failed
                        CMake Warning at cmake/OpenCVDownload.cmake:202 (message):
                        FFMPEG: Download failed: 35;"SSL connect error"
                        For details please refer to the download log file:
                        C:/Qt/opencv_cv2/opencv/release/CMakeDownloadLog.txt
                        Call Stack (most recent call first):
                        3rdparty/ffmpeg/ffmpeg.cmake:20 (ocv_download)
                        modules/videoio/cmake/detect_ffmpeg.cmake:14 (download_win_ffmpeg)
                        modules/videoio/cmake/init.cmake:7 (include)
                        modules/videoio/cmake/init.cmake:18 (add_backend)
                        cmake/OpenCVModule.cmake:298 (include)
                        cmake/OpenCVModule.cmake:361 (_add_modules_1)
                        modules/CMakeLists.txt:7 (ocv_glob_modules)
                        FFMPEG: Download: ffmpeg_version.cmake
                        Try 1 failed
                        CMake Warning at cmake/OpenCVDownload.cmake:202 (message):
                        FFMPEG: Download failed: 35;"SSL connect error"
                        For details please refer to the download log file:
                        C:/Qt/opencv_cv2/opencv/release/CMakeDownloadLog.txt
                        Call Stack (most recent call first):
                        3rdparty/ffmpeg/ffmpeg.cmake:20 (ocv_download)
                        modules/videoio/cmake/detect_ffmpeg.cmake:14 (download_win_ffmpeg)
                        modules/videoio/cmake/init.cmake:7 (include)
                        modules/videoio/cmake/init.cmake:18 (add_backend)
                        cmake/OpenCVModule.cmake:298 (include)
                        cmake/OpenCVModule.cmake:361 (_add_modules_1)
                        modules/CMakeLists.txt:7 (ocv_glob_modules)
                        }
                        //........................................
                        {
                        Performing Test HAVE_CXX_WNO_UNUSED_PRIVATE_FIELD - Failed
                        CMake Warning at cmake/OpenCVGenSetupVars.cmake:54 (message):
                        CONFIGURATION IS NOT SUPPORTED: validate setupvars script in install
                        directory
                        Call Stack (most recent call first):
                        CMakeLists.txt:1010 (include)
                        }

                        1 Reply Last reply
                        0
                        • mrjjM Offline
                          mrjjM Offline
                          mrjj
                          Lifetime Qt Champion
                          wrote on last edited by
                          #27

                          Hi
                          Could you try with python 2.7 instead?

                          It seems to complain about the 3.7 version

                          CMake's 'find_host_package(PythonInterp 2.7)' found wrong Python version:
                          Could NOT find Python2 (missing: Python2_EXECUTABLE Interpreter)
                          Wrong major version for the interpreter "C:/Users/test/AppData/Local/Programs/Python/Python37/python.exe"

                          1 Reply Last reply
                          0
                          • Negar_mgN Offline
                            Negar_mgN Offline
                            Negar_mg
                            wrote on last edited by
                            #28

                            How can i try it with python 2.7? What should i change in tutorial steps?

                            jsulmJ mrjjM 2 Replies Last reply
                            0
                            • Negar_mgN Negar_mg

                              How can i try it with python 2.7? What should i change in tutorial steps?

                              jsulmJ Offline
                              jsulmJ Offline
                              jsulm
                              Lifetime Qt Champion
                              wrote on last edited by
                              #29

                              @Negar_mg You should install Python 2.7

                              https://forum.qt.io/topic/113070/qt-code-of-conduct

                              1 Reply Last reply
                              0
                              • Negar_mgN Negar_mg

                                How can i try it with python 2.7? What should i change in tutorial steps?

                                mrjjM Offline
                                mrjjM Offline
                                mrjj
                                Lifetime Qt Champion
                                wrote on last edited by
                                #30

                                @Negar_mg

                                All steps the same.
                                Simply install python 2.7 and see if it then
                                sounds happier

                                1 Reply Last reply
                                0
                                • Negar_mgN Offline
                                  Negar_mgN Offline
                                  Negar_mg
                                  wrote on last edited by
                                  #31

                                  I installed Python 2.7, checked that it was installed with the python -v command in cmd, then according to this link

                                  //...........................................................................................

                                  https://wiki.qt.io/How_to_setup_Qt_and_openCV_on_Windows
                                  //...........................................................................................
                                  In cmake, I selected the source and destination, but after clicking the configure button, I encountered these errors:
                                  //...........................................................................................
                                  {
                                  Performing Test HAVE_CXX_WNO_ENUM_COMPARE_SWITCH - Failed
                                  Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
                                  VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
                                  ADE: Download: v0.1.1f.zip
                                  Try 1 failed
                                  CMake Warning at cmake/OpenCVDownload.cmake:202 (message):
                                  ADE: Download failed: 35;"SSL connect error"

                                  For details please refer to the download log file:

                                  C:/Qt/opencv_cv2/opencv/Release/CMakeDownloadLog.txt

                                  Call Stack (most recent call first):
                                  modules/gapi/cmake/DownloadADE.cmake:5 (ocv_download)
                                  modules/gapi/cmake/init.cmake:19 (include)
                                  cmake/OpenCVModule.cmake:298 (include)
                                  cmake/OpenCVModule.cmake:361 (_add_modules_1)
                                  modules/CMakeLists.txt:7 (ocv_glob_modules)

                                  OpenCV Python: during development append to PYTHONPATH: C:/Qt/opencv_cv2/opencv/Release/python_loader
                                  Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
                                  FFMPEG: Download: opencv_videoio_ffmpeg.dll
                                  Try 1 failed
                                  CMake Warning at cmake/OpenCVDownload.cmake:202 (message):
                                  FFMPEG: Download failed: 35;"SSL connect error"

                                  For details please refer to the download log file:

                                  C:/Qt/opencv_cv2/opencv/Release/CMakeDownloadLog.txt

                                  Call Stack (most recent call first):
                                  3rdparty/ffmpeg/ffmpeg.cmake:20 (ocv_download)
                                  modules/videoio/cmake/detect_ffmpeg.cmake:14 (download_win_ffmpeg)
                                  modules/videoio/cmake/init.cmake:7 (include)
                                  modules/videoio/cmake/init.cmake:18 (add_backend)
                                  cmake/OpenCVModule.cmake:298 (include)
                                  cmake/OpenCVModule.cmake:361 (_add_modules_1)
                                  modules/CMakeLists.txt:7 (ocv_glob_modules)

                                  FFMPEG: Download: opencv_videoio_ffmpeg_64.dll
                                  Try 1 failed
                                  CMake Warning at cmake/OpenCVDownload.cmake:202 (message):
                                  FFMPEG: Download failed: 35;"SSL connect error"

                                  For details please refer to the download log file:

                                  C:/Qt/opencv_cv2/opencv/Release/CMakeDownloadLog.txt

                                  Call Stack (most recent call first):
                                  3rdparty/ffmpeg/ffmpeg.cmake:20 (ocv_download)
                                  modules/videoio/cmake/detect_ffmpeg.cmake:14 (download_win_ffmpeg)
                                  modules/videoio/cmake/init.cmake:7 (include)
                                  modules/videoio/cmake/init.cmake:18 (add_backend)
                                  cmake/OpenCVModule.cmake:298 (include)
                                  cmake/OpenCVModule.cmake:361 (_add_modules_1)
                                  modules/CMakeLists.txt:7 (ocv_glob_modules)

                                  FFMPEG: Download: ffmpeg_version.cmake
                                  Try 1 failed
                                  CMake Warning at cmake/OpenCVDownload.cmake:202 (message):
                                  FFMPEG: Download failed: 35;"SSL connect error"

                                  For details please refer to the download log file:

                                  C:/Qt/opencv_cv2/opencv/Release/CMakeDownloadLog.txt

                                  Call Stack (most recent call first):
                                  3rdparty/ffmpeg/ffmpeg.cmake:20 (ocv_download)
                                  modules/videoio/cmake/detect_ffmpeg.cmake:14 (download_win_ffmpeg)
                                  modules/videoio/cmake/init.cmake:7 (include)
                                  modules/videoio/cmake/init.cmake:18 (add_backend)
                                  cmake/OpenCVModule.cmake:298 (include)
                                  cmake/OpenCVModule.cmake:361 (_add_modules_1)
                                  modules/CMakeLists.txt:7 (ocv_glob_modules)

                                  }

                                  1 Reply Last reply
                                  0
                                  • Negar_mgN Offline
                                    Negar_mgN Offline
                                    Negar_mg
                                    wrote on last edited by Negar_mg
                                    #32

                                    @mrjj ,
                                    @SGaist
                                    Please Help me ,
                                    How can I fix these errors?

                                    jsulmJ 1 Reply Last reply
                                    0
                                    • Negar_mgN Negar_mg

                                      @mrjj ,
                                      @SGaist
                                      Please Help me ,
                                      How can I fix these errors?

                                      jsulmJ Offline
                                      jsulmJ Offline
                                      jsulm
                                      Lifetime Qt Champion
                                      wrote on last edited by
                                      #33

                                      @Negar_mg I don't know how. This is an OpenCV issue and has nothing to do with Qt. Please ask in an OpenCV forum.

                                      You should at least consider doing what the error output suggests:
                                      "For details please refer to the download log file:

                                      C:/Qt/opencv_cv2/opencv/Release/CMakeDownloadLog.txt"
                                      It looks like it can't download some dependencies.

                                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                                      1 Reply Last reply
                                      0
                                      • Negar_mgN Offline
                                        Negar_mgN Offline
                                        Negar_mg
                                        wrote on last edited by
                                        #34

                                        Yes. I know that it cannot download a link, but i have no idea how to fix it. Could you please give me a hint

                                        «Error»
                                        {
                                        ADE: Download: v0.1.1f.zip
                                        Try 1 failed
                                        CMake Warning at cmake/OpenCVDownload.cmake:202 (message):
                                        ADE: Download failed: 35;"SSL connect error"

                                        For details please refer to the download log file:

                                        C:/Qt/opencv_cv2/opencv/Release/CMakeDownloadLog.txt

                                        Call Stack (most recent call first):
                                        modules/gapi/cmake/DownloadADE.cmake:5 (ocv_download)
                                        modules/gapi/cmake/init.cmake:19 (include)
                                        cmake/OpenCVModule.cmake:298 (include)
                                        cmake/OpenCVModule.cmake:361 (_add_modules_1)
                                        modules/CMakeLists.txt:7 (ocv_glob_modules)

                                        }

                                        jsulmJ 1 Reply Last reply
                                        0
                                        • Negar_mgN Negar_mg

                                          Yes. I know that it cannot download a link, but i have no idea how to fix it. Could you please give me a hint

                                          «Error»
                                          {
                                          ADE: Download: v0.1.1f.zip
                                          Try 1 failed
                                          CMake Warning at cmake/OpenCVDownload.cmake:202 (message):
                                          ADE: Download failed: 35;"SSL connect error"

                                          For details please refer to the download log file:

                                          C:/Qt/opencv_cv2/opencv/Release/CMakeDownloadLog.txt

                                          Call Stack (most recent call first):
                                          modules/gapi/cmake/DownloadADE.cmake:5 (ocv_download)
                                          modules/gapi/cmake/init.cmake:19 (include)
                                          cmake/OpenCVModule.cmake:298 (include)
                                          cmake/OpenCVModule.cmake:361 (_add_modules_1)
                                          modules/CMakeLists.txt:7 (ocv_glob_modules)

                                          }

                                          jsulmJ Offline
                                          jsulmJ Offline
                                          jsulm
                                          Lifetime Qt Champion
                                          wrote on last edited by
                                          #35

                                          @Negar_mg I never built OpenCV and this is Qt forum, not OpenCV.

                                          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