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. Errors with Qt5Core.dll

Errors with Qt5Core.dll

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 4 Posters 4.8k Views
  • 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.
  • V Offline
    V Offline
    Vics
    wrote on last edited by kshegunov
    #1

    Hi,
    I'm trying to run first OpenCV (3.10) example with Qt (5.7) at Windows 7.

    Here is the PRO file

    QT       += core
    QT       -= gui
    TARGET = myFirstOpenCVProject
    CONFIG   += console
    CONFIG   -= app_bundle
    TEMPLATE = app
    SOURCES += main.cpp
    
    INCLUDEPATH += "E:\\opencv\\release\\include" \
                       "E:\\opencv\\release\\include\\opencv" \
                       "E:\\opencv\\release\\include\\opencv2"
    
    LIBS += -LE:\\opencv\\release\\x86\\mingw\\lib \
        -llibopencv_imgcodecs310.dll \
        -llibopencv_core310.dll \
        -llibopencv_highgui310.dll \
        -llibopencv_imgproc310.dll \
        -llibopencv_features2d310.dll \
        -llibopencv_calib3d310.dll \
    
    
    The C++ code
    
    #include <opencv2/core/core.hpp>
    #include <opencv2/highgui/highgui.hpp>
    
    int main()
    {
    	cv::Mat image= cv::imread("E:\\work\\qt\\myFirstOpenCVProject\\img.jpg");
            cv::namedWindow("My Image");
            cv::imshow("My Image", image);
            cv::waitKey(50000);
            return 1;
    }
    

    If I run it in Qt Creator, the picture is showing.
    But if I run that without QTCreator - I've error

    Entry point into procedure _Z21qRegisterResourceDataiPKhS0_S0 not find in library DLL Qt5Core.dll
    

    I was looking this forum. I find that need to copy Qt5Core.dll from C:\Qt\Qt5.7.1\5.7\mingw53_32\bin
    to my project folder. If I do that i've another error

    The procedure entry point ?left@QString@@QBE>AV1@H@Z could't be found in library DLL Qt5Core.dll
    

    Does somebody have any idea ?

    Thanks at advance

    [Code tags added ~kshegunov]

    A 1 Reply Last reply
    0
    • M Offline
      M Offline
      MrOplus
      wrote on last edited by
      #2

      use the windeployqt to deploy your application it will compile QT* libs for your application .

      1 Reply Last reply
      0
      • V Offline
        V Offline
        Vics
        wrote on last edited by
        #3

        Through the Qt5.7 command line, I'm typed

        windeployqt E:\work\qt\build-myFirstOpenCVProject-Desktop_Qt_5_7_1_MinGW_32bit-Release\release

        Here is the output

        E:\work\qt\build-myFirstOpenCVProject-Desktop_Qt_5_7_1_MinGW_32bit-Release\releaseE:\work\qt\build-myFirstOpenCVProject-Desktop_Qt_5_7_1_MinGW_32bit-Release\release\myFirstOpenCVProject.exe 32 bit,release executable

        E:\work\qt\build-myFirstOpenCVProject-Desktop_Qt_5_7_1_MinGW_32bit-Release\releaseE:\work\qt\build-myFirstOpenCVProject-Desktop_Qt_5_7_1_MinGW_32bit-Release\release\myFirstOpenCVProject.exe does not seem to be a Qt executable

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

          Hi,

          Technically, it's indeed not a Qt executable since there's nothing Qt in it at all. Unless you built OpenCV with Qt as highgui backend but even so, your application still doesn't use Qt.

          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
          1
          • V Vics

            Hi,
            I'm trying to run first OpenCV (3.10) example with Qt (5.7) at Windows 7.

            Here is the PRO file

            QT       += core
            QT       -= gui
            TARGET = myFirstOpenCVProject
            CONFIG   += console
            CONFIG   -= app_bundle
            TEMPLATE = app
            SOURCES += main.cpp
            
            INCLUDEPATH += "E:\\opencv\\release\\include" \
                               "E:\\opencv\\release\\include\\opencv" \
                               "E:\\opencv\\release\\include\\opencv2"
            
            LIBS += -LE:\\opencv\\release\\x86\\mingw\\lib \
                -llibopencv_imgcodecs310.dll \
                -llibopencv_core310.dll \
                -llibopencv_highgui310.dll \
                -llibopencv_imgproc310.dll \
                -llibopencv_features2d310.dll \
                -llibopencv_calib3d310.dll \
            
            
            The C++ code
            
            #include <opencv2/core/core.hpp>
            #include <opencv2/highgui/highgui.hpp>
            
            int main()
            {
            	cv::Mat image= cv::imread("E:\\work\\qt\\myFirstOpenCVProject\\img.jpg");
                    cv::namedWindow("My Image");
                    cv::imshow("My Image", image);
                    cv::waitKey(50000);
                    return 1;
            }
            

            If I run it in Qt Creator, the picture is showing.
            But if I run that without QTCreator - I've error

            Entry point into procedure _Z21qRegisterResourceDataiPKhS0_S0 not find in library DLL Qt5Core.dll
            

            I was looking this forum. I find that need to copy Qt5Core.dll from C:\Qt\Qt5.7.1\5.7\mingw53_32\bin
            to my project folder. If I do that i've another error

            The procedure entry point ?left@QString@@QBE>AV1@H@Z could't be found in library DLL Qt5Core.dll
            

            Does somebody have any idea ?

            Thanks at advance

            [Code tags added ~kshegunov]

            A Offline
            A Offline
            ambershark
            wrote on last edited by
            #5

            @Vics You are using the wrong version of Qt dlls. This happens when the dll that is loaded is built by a different compiler. I.e. you have a Qt5Core.dll on your system in your system path that is built by MSVC and then you built (say using Qt Creator) a Qt5Core.dll that was built with mingw. So your app uses the mingw one but when you run it, it picks up the MSVC version.

            Since this scenario is not compatible you get that can not find entry point error.

            The windeployqt thing can fix it as it will put the correct dlls in the exe path which will be used above the system ones. Just wanted to explain in depth why this was happening so you could fix it manually (without windeploy) if you so chose.

            My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

            1 Reply Last reply
            1
            • V Offline
              V Offline
              Vics
              wrote on last edited by
              #6

              Hi,

              Thank you for your reply.

              I checked my comp for Qt5Core.dll.
              The results were very intresting becouse Qt5Core.dll discovered in CMake folder. This folder was set in Path system variable.
              During installing CMake this folder was added to Path variable.

              I removed this folder from Path. Now my program working without QtCreator.

              Thanks a lot

              A 1 Reply Last reply
              1
              • V Vics

                Hi,

                Thank you for your reply.

                I checked my comp for Qt5Core.dll.
                The results were very intresting becouse Qt5Core.dll discovered in CMake folder. This folder was set in Path system variable.
                During installing CMake this folder was added to Path variable.

                I removed this folder from Path. Now my program working without QtCreator.

                Thanks a lot

                A Offline
                A Offline
                ambershark
                wrote on last edited by
                #7

                @Vics No problem. :) Don't forget to mark this as solved for future people.

                My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

                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