Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Cannot mix incompatible Qt library
Forum Updated to NodeBB v4.3 + New Features

Cannot mix incompatible Qt library

Scheduled Pinned Locked Moved Solved Installation and Deployment
32 Posts 4 Posters 18.5k Views 2 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.
  • Christian EhrlicherC Christian Ehrlicher

    @Tamfub said in Cannot mix incompatible Qt library:

    Updating qsqlmysql.dll.

    As you can see the plugin is copied, you have to make sure that the dependencies are also available (search the forum, use Dependency Walker)

    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../5.15.1/mingw81_64/plugins/sqldrivers/mysql-connector-c-6.1.11-winx64/lib/ -llibmysql
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../5.15.1/mingw81_64/plugins/sqldrivers/mysql-connector-c-6.1.11-winx64/lib/ -llibmysqld
    
    INCLUDEPATH += $$PWD/../../../../../5.15.1/mingw81_64/plugins/sqldrivers/mysql-connector-c-6.1.11-winx64/include
    DEPENDPATH += $$PWD/../../../../../5.15.1/mingw81_64/plugins/sqldrivers/mysql-connector-c-6.1.11-winx64/include
    

    What do you think do gain with this? It's not needed at all.

    T Offline
    T Offline
    Tamfub
    wrote on last edited by Tamfub
    #22

    @Christian-Ehrlicher said in Cannot mix incompatible Qt library:

    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../5.15.1/mingw81_64/plugins/sqldrivers/mysql-connector-c-6.1.11-winx64/lib/ -llibmysql
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../5.15.1/mingw81_64/plugins/sqldrivers/mysql-connector-c-6.1.11-winx64/lib/ -llibmysqld

    INCLUDEPATH += $$PWD/../../../../../5.15.1/mingw81_64/plugins/sqldrivers/mysql-connector-c-6.1.11-winx64/include
    DEPENDPATH += $$PWD/../../../../../5.15.1/mingw81_64/plugins/sqldrivers/mysql-connector-c-6.1.11-winx64/include

    What do you think do gain with this? It's not needed at all.
    

    If I don't include this, I get this while running my program in Qt:

    QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/5.15.1/mingw81_64/plugins/sqldrivers" ...
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/5.15.1/mingw81_64/plugins/sqldrivers/qsqlite.dll"
    Found metadata in lib C:/Qt/5.15.1/mingw81_64/plugins/sqldrivers/qsqlite.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
            "Keys": [
                "QSQLITE"
            ]
        },
        "archreq": 0,
        "className": "QSQLiteDriverPlugin",
        "debug": false,
        "version": 331520
    }
    
    
    Got keys from plugin meta data ("QSQLITE")
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/5.15.1/mingw81_64/plugins/sqldrivers/qsqlmysql.dll"
    Found metadata in lib C:/Qt/5.15.1/mingw81_64/plugins/sqldrivers/qsqlmysql.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
            "Keys": [
                "QMYSQL3",
                "QMYSQL",
                "QMARIADB"
            ]
        },
        "archreq": 0,
        "className": "QMYSQLDriverPlugin",
        "debug": false,
        "version": 331520
    }
    
    
    Got keys from plugin meta data ("QMYSQL3", "QMYSQL", "QMARIADB")
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt/5.15.1/mingw81_64/plugins/sqldrivers/qsqlodbc.dll"
    Found metadata in lib C:/Qt/5.15.1/mingw81_64/plugins/sqldrivers/qsqlodbc.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
            "Keys": [
                "QODBC3",
                "QODBC"
            ]
        },
        "archreq": 0,
        "className": "QODBCDriverPlugin",
        "debug": false,
        "version": 331520
    }
    
    
    Got keys from plugin meta data ("QODBC3", "QODBC")
    QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/Projects/tutorial/progettoMalnati/sharedtexteditor/build-progettoMalnati_srv_2-Desktop_Qt_5_15_1_MinGW_64_bit-Release/release/sqldrivers" ...
    Cannot load library C:\Qt\5.15.1\mingw81_64\plugins\sqldrivers\qsqlmysql.dll: Impossibile trovare il modulo specificato.
    QLibraryPrivate::loadPlugin failed on "C:/Qt/5.15.1/mingw81_64/plugins/sqldrivers/qsqlmysql.dll" : "Cannot load library C:\\Qt\\5.15.1\\mingw81_64\\plugins\\sqldrivers\\qsqlmysql.dll: Impossibile trovare il modulo specificato."
    QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QMARIADB QMYSQL QMYSQL3 QODBC QODBC3
    Errore nel collegamento al DB
    "Driver not loaded Driver not loaded"
    

    i.e. it cannot load the MYSQL driver. Also, Dependency Walker is taking ages to analyze my .exe. They say it is a normal behaviour, but 5 minutes is too much I guess.

    1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #23

      @Tamfub said in Cannot mix incompatible Qt library:

      If I don't include this, I get this while running my program in Qt:

      You're aware that some compiler options and loading a plugin has nothing to do with each other? It's not needed. The only thing you need is (as I already told you) that the program finds the dependencies for your plugin, for instance the mysql dll (search the forum)

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      T Christian EhrlicherC 2 Replies Last reply
      1
      • Christian EhrlicherC Christian Ehrlicher

        @Tamfub said in Cannot mix incompatible Qt library:

        If I don't include this, I get this while running my program in Qt:

        You're aware that some compiler options and loading a plugin has nothing to do with each other? It's not needed. The only thing you need is (as I already told you) that the program finds the dependencies for your plugin, for instance the mysql dll (search the forum)

        T Offline
        T Offline
        Tamfub
        wrote on last edited by Tamfub
        #24

        @Christian-Ehrlicher
        After a long time I managed to analyze the .exe on Dependency Walker, and I got this in the log window:

        LoadLibraryW("C:\qt\projects\tutorial\progettomalnati\sharedtexteditor\build-progettomalnati_srv_2-desktop_qt_5_15_1_mingw_64_bit-release\release\sqldrivers\qsqlmysql.dll") called from "QT5CORE.DLL" at address 0x0000000068A61823.
        Loaded "QSQLMYSQL.DLL" at address 0x000000006C5C0000.  Successfully hooked module.
        Unloaded "QSQLMYSQL.DLL" at address 0x000000006C5C0000.
        LoadLibraryW("C:\qt\projects\tutorial\progettomalnati\sharedtexteditor\build-progettomalnati_srv_2-desktop_qt_5_15_1_mingw_64_bit-release\release\sqldrivers\qsqlmysql.dll") returned NULL. Error: Impossibile trovare il modulo specificato (126).
        QSqlDatabase: QMYSQL driver not loaded
        QSqlDatabase: available drivers: QSQLITE QMARIADB QMYSQL QMYSQL3 QODBC QODBC3
        Errore nel collegamento al DB
        "Driver not loaded Driver not loaded"
        

        409b70c3-803c-4131-bfb0-db948bbcae23-image.png

        But this file is in the folder!
        236acba2-27f2-4132-8377-3bd18231ccc1-image.png

        1 Reply Last reply
        0
        • Christian EhrlicherC Online
          Christian EhrlicherC Online
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #25

          @Tamfub said in Cannot mix incompatible Qt library:

          But this file is in the folder!

          I know, but you don't read what I tell you (already two times) - the plugins has some dependencies to other libraries which must be available... !

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          T 1 Reply Last reply
          0
          • Christian EhrlicherC Christian Ehrlicher

            @Tamfub said in Cannot mix incompatible Qt library:

            But this file is in the folder!

            I know, but you don't read what I tell you (already two times) - the plugins has some dependencies to other libraries which must be available... !

            T Offline
            T Offline
            Tamfub
            wrote on last edited by
            #26

            @Christian-Ehrlicher I actually read what you wrote. But I don't get which libraries must be available, then. Maybe I'm missing a LIBS directive in the .pro file?

            1 Reply Last reply
            0
            • Christian EhrlicherC Christian Ehrlicher

              @Tamfub said in Cannot mix incompatible Qt library:

              If I don't include this, I get this while running my program in Qt:

              You're aware that some compiler options and loading a plugin has nothing to do with each other? It's not needed. The only thing you need is (as I already told you) that the program finds the dependencies for your plugin, for instance the mysql dll (search the forum)

              Christian EhrlicherC Online
              Christian EhrlicherC Online
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #27

              @Christian-Ehrlicher said in Cannot mix incompatible Qt library:

              . The only thing you need is (as I already told you) that the program finds the dependencies for your plugin, for instance the mysql dll (search the forum)

              ...

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              T 1 Reply Last reply
              0
              • Christian EhrlicherC Christian Ehrlicher

                @Christian-Ehrlicher said in Cannot mix incompatible Qt library:

                . The only thing you need is (as I already told you) that the program finds the dependencies for your plugin, for instance the mysql dll (search the forum)

                ...

                T Offline
                T Offline
                Tamfub
                wrote on last edited by
                #28

                Hi.

                @JKSH said in Cannot mix incompatible Qt library:

                I just noticed something else: It looks like you are using 64-bit Qt and 64-bit MinGW. Therefore, you must also use the 64-bit MySQL C connector. (Your screenshots show that you've installed 32-bit MySQL)

                I missed this passage. At the moment, I have two choices:

                Install 32-bit MySQL - I visited this page but there's no 64-bit version.
                8b7915f3-1a2c-408a-a07a-89ee09db7da9-image.png

                Use 32-bit Qt and 32-bit MinGW (both are already installed on my PC) - Qt version can be changed from the "Manage kits" tool, but how do I change the qmake version?
                575e16c1-477b-4921-8435-9755588f3998-image.png

                JKSHJ 1 Reply Last reply
                0
                • T Tamfub

                  Hi.

                  @JKSH said in Cannot mix incompatible Qt library:

                  I just noticed something else: It looks like you are using 64-bit Qt and 64-bit MinGW. Therefore, you must also use the 64-bit MySQL C connector. (Your screenshots show that you've installed 32-bit MySQL)

                  I missed this passage. At the moment, I have two choices:

                  Install 32-bit MySQL - I visited this page but there's no 64-bit version.
                  8b7915f3-1a2c-408a-a07a-89ee09db7da9-image.png

                  Use 32-bit Qt and 32-bit MinGW (both are already installed on my PC) - Qt version can be changed from the "Manage kits" tool, but how do I change the qmake version?
                  575e16c1-477b-4921-8435-9755588f3998-image.png

                  JKSHJ Offline
                  JKSHJ Offline
                  JKSH
                  Moderators
                  wrote on last edited by
                  #29

                  @Tamfub said in Cannot mix incompatible Qt library:

                  @JKSH said in Cannot mix incompatible Qt library:

                  I just noticed something else: It looks like you are using 64-bit Qt and 64-bit MinGW. Therefore, you must also use the 64-bit MySQL C connector. (Your screenshots show that you've installed 32-bit MySQL)

                  I missed this passage.

                  That's OK. mysql-connector-c-6.1.11-winx64 is 64-bit.

                  After a long time I managed to analyze the .exe on Dependency Walker

                  Ask Dependency Walker to open qsqlmysql.dll instead of your .exe.

                  Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                  T 1 Reply Last reply
                  1
                  • JKSHJ JKSH

                    @Tamfub said in Cannot mix incompatible Qt library:

                    @JKSH said in Cannot mix incompatible Qt library:

                    I just noticed something else: It looks like you are using 64-bit Qt and 64-bit MinGW. Therefore, you must also use the 64-bit MySQL C connector. (Your screenshots show that you've installed 32-bit MySQL)

                    I missed this passage.

                    That's OK. mysql-connector-c-6.1.11-winx64 is 64-bit.

                    After a long time I managed to analyze the .exe on Dependency Walker

                    Ask Dependency Walker to open qsqlmysql.dll instead of your .exe.

                    T Offline
                    T Offline
                    Tamfub
                    wrote on last edited by
                    #30

                    Ask Dependency Walker to open qsqlmysql.dll instead of your .exe.

                    It seems there are a bunch problems...
                    6f203713-711b-4f64-9e8a-5f9f1e9f8286-image.png

                    What now?

                    JKSHJ 1 Reply Last reply
                    0
                    • T Tamfub

                      Ask Dependency Walker to open qsqlmysql.dll instead of your .exe.

                      It seems there are a bunch problems...
                      6f203713-711b-4f64-9e8a-5f9f1e9f8286-image.png

                      What now?

                      JKSHJ Offline
                      JKSHJ Offline
                      JKSH
                      Moderators
                      wrote on last edited by
                      #31

                      @Tamfub said in Cannot mix incompatible Qt library:

                      It seems there are a bunch problems...

                      Ignore API-MS-WIN-*.dll and EXT-MS-WIN-.dll. Those are not real problems.

                      However, libmysql.dll is a real problem. If it is missing, your program cannot load qsqlmysql.dll.

                      This is what @Christian-Ehrlicher meant by "dependency": qsqlmysql.dll depends on libmysql.dll. You must deploy all of your dependencies.

                      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                      T 1 Reply Last reply
                      3
                      • JKSHJ JKSH

                        @Tamfub said in Cannot mix incompatible Qt library:

                        It seems there are a bunch problems...

                        Ignore API-MS-WIN-*.dll and EXT-MS-WIN-.dll. Those are not real problems.

                        However, libmysql.dll is a real problem. If it is missing, your program cannot load qsqlmysql.dll.

                        This is what @Christian-Ehrlicher meant by "dependency": qsqlmysql.dll depends on libmysql.dll. You must deploy all of your dependencies.

                        T Offline
                        T Offline
                        Tamfub
                        wrote on last edited by
                        #32

                        I finally managed to make it work now: I just copied libmysql.dll from C:\Program Files\MySQL\MySQL Connector C 6.1\lib into the release folder (the same of the .exe) :)

                        Thank you all so much for your kind patience!

                        1 Reply Last reply
                        2

                        • Login

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