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. Added QMysql plugin to Qt Creator project on MacOS Ventura 13.4
Forum Updated to NodeBB v4.3 + New Features

Added QMysql plugin to Qt Creator project on MacOS Ventura 13.4

Scheduled Pinned Locked Moved Solved General and Desktop
53 Posts 4 Posters 20.6k 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.
  • S SGaist
    29 May 2023, 19:29

    Unless I am mistaken, your Qt build is a universal build. I.e. it contains both the x86_64 and arm64 symbols. Hence you need to also use a universal MySQL library to link to. If you only have separated libraries for each architecture, you can use lipo to combine them and the use that one.

    B Offline
    B Offline
    BushyAxis793
    wrote on 30 May 2023, 15:12 last edited by
    #25

    @SGaist I find command line for lipo. I copied x86 and arm folders on my desktop and input this in terminal:

    lipo /Users/mikolajnawrocki/Desktop/mysql-8.0.33-macos13-x86_64/lib/libmysqlclient.dylib /Users/mikolajnawrocki/Desktop/mysql-8.0.33-macos13-arm64/lib/libmysqlclient.dylib -output /Users/mikolajnawrocki/Desktop/universal/libmysqlclient.dylib -create
    

    In the folder appeared much bigger libmysqlclient.dylib. So I guess fusion was completed.

    Then I copied new file to /usr/local/mysql/lib/libmysqlclient.dylib" and paste it. Then I run Qt Creator. The last errors disappeared. But I still got error with mysql plugin.

    87ac4678-2140-4fb7-a1a9-4b3f3ccf01f5-image.png

    Below is my folder structure of build-sqldrivers

    8cb51c7b-aac2-4e77-8e34-dcba4cb39a58-image.png

    123d421b-d700-4440-b3c3-426dc88acdbd-image.png

    S 1 Reply Last reply 30 May 2023, 18:32
    0
    • B BushyAxis793
      30 May 2023, 15:12

      @SGaist I find command line for lipo. I copied x86 and arm folders on my desktop and input this in terminal:

      lipo /Users/mikolajnawrocki/Desktop/mysql-8.0.33-macos13-x86_64/lib/libmysqlclient.dylib /Users/mikolajnawrocki/Desktop/mysql-8.0.33-macos13-arm64/lib/libmysqlclient.dylib -output /Users/mikolajnawrocki/Desktop/universal/libmysqlclient.dylib -create
      

      In the folder appeared much bigger libmysqlclient.dylib. So I guess fusion was completed.

      Then I copied new file to /usr/local/mysql/lib/libmysqlclient.dylib" and paste it. Then I run Qt Creator. The last errors disappeared. But I still got error with mysql plugin.

      87ac4678-2140-4fb7-a1a9-4b3f3ccf01f5-image.png

      Below is my folder structure of build-sqldrivers

      8cb51c7b-aac2-4e77-8e34-dcba4cb39a58-image.png

      123d421b-d700-4440-b3c3-426dc88acdbd-image.png

      S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 30 May 2023, 18:32 last edited by
      #26

      If you copy the file on the command line, it will, by default, copy the content of the pointed file and thus you will have the library you want.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      B 1 Reply Last reply 30 May 2023, 19:10
      1
      • S SGaist
        30 May 2023, 18:32

        If you copy the file on the command line, it will, by default, copy the content of the pointed file and thus you will have the library you want.

        B Offline
        B Offline
        BushyAxis793
        wrote on 30 May 2023, 19:10 last edited by
        #27

        @SGaist So what I should doing now? The universal libqmysqlclient.dylib is in the correct place. I got no errors in Terminal. But I got one in Qt Creator.

        S 1 Reply Last reply 30 May 2023, 19:12
        0
        • B BushyAxis793
          30 May 2023, 19:10

          @SGaist So what I should doing now? The universal libqmysqlclient.dylib is in the correct place. I got no errors in Terminal. But I got one in Qt Creator.

          S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 30 May 2023, 19:12 last edited by
          #28

          Which error are you getting now ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          B 1 Reply Last reply 30 May 2023, 19:25
          1
          • S SGaist
            30 May 2023, 19:12

            Which error are you getting now ?

            B Offline
            B Offline
            BushyAxis793
            wrote on 30 May 2023, 19:25 last edited by
            #29

            @SGaist Error below

            QSqlDatabase: QMYSQL driver not loaded
            QSqlDatabase: available drivers: QSQLITE QODBC QPSQL
            
            S 1 Reply Last reply 30 May 2023, 19:39
            0
            • B BushyAxis793
              30 May 2023, 19:25

              @SGaist Error below

              QSqlDatabase: QMYSQL driver not loaded
              QSqlDatabase: available drivers: QSQLITE QODBC QPSQL
              
              S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 30 May 2023, 19:39 last edited by
              #30

              Did you ensure that the plugin was put in the plugins folder ? Did you build it for both debug and release ? Did you copy both variants to the appropriate subfolder ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              B 1 Reply Last reply 30 May 2023, 20:22
              1
              • S SGaist
                30 May 2023, 19:39

                Did you ensure that the plugin was put in the plugins folder ? Did you build it for both debug and release ? Did you copy both variants to the appropriate subfolder ?

                B Offline
                B Offline
                BushyAxis793
                wrote on 30 May 2023, 20:22 last edited by
                #31

                @SGaist I think I did.

                Copied files from

                /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/build-sqldrivers/plugins/sqldrivers

                to

                /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers

                Builded debug and release

                8f4769b6-5d99-46a9-a979-3a9934154088-image.png

                S 1 Reply Last reply 30 May 2023, 20:28
                0
                • B BushyAxis793
                  30 May 2023, 20:22

                  @SGaist I think I did.

                  Copied files from

                  /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/build-sqldrivers/plugins/sqldrivers

                  to

                  /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers

                  Builded debug and release

                  8f4769b6-5d99-46a9-a979-3a9934154088-image.png

                  S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 30 May 2023, 20:28 last edited by
                  #32

                  As already requested, stop working in the installation tree, create the build dir completely outside of it.

                  Start your application with the QT_DEBUG_PLUGINS environment variable set to 1 to see what is happening with the plugins.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  B 1 Reply Last reply 31 May 2023, 15:03
                  1
                  • S SGaist
                    30 May 2023, 20:28

                    As already requested, stop working in the installation tree, create the build dir completely outside of it.

                    Start your application with the QT_DEBUG_PLUGINS environment variable set to 1 to see what is happening with the plugins.

                    B Offline
                    B Offline
                    BushyAxis793
                    wrote on 31 May 2023, 15:03 last edited by
                    #33

                    @SGaist Ok sorry. I delete build-sqldrivers from Qt directory and build one more time on my desktop. I input QT_DEBUG_PLUGINS in my code and I got this:

                    qt.core.plugin.factoryloader: checking directory path "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/platforms" ...
                    qt.core.plugin.factoryloader: looking at "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/platforms/libqoffscreen.dylib"
                    qt.core.plugin.loader: Found metadata in lib /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/platforms/libqoffscreen.dylib, metadata=
                    {
                        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
                        "MetaData": {
                            "Keys": [
                                "offscreen"
                            ]
                        },
                        "archlevel": 0,
                        "className": "QOffscreenIntegrationPlugin",
                        "debug": false,
                        "version": 394496
                    }
                    
                    
                    qt.core.plugin.factoryloader: Got keys from plugin meta data QList("offscreen")
                    qt.core.plugin.factoryloader: looking at "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/platforms/libqminimal.dylib"
                    qt.core.plugin.loader: Found metadata in lib /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/platforms/libqminimal.dylib, metadata=
                    {
                        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
                        "MetaData": {
                            "Keys": [
                                "minimal"
                            ]
                        },
                        "archlevel": 0,
                        "className": "QMinimalIntegrationPlugin",
                        "debug": false,
                        "version": 394496
                    }
                    
                    
                    qt.core.plugin.factoryloader: Got keys from plugin meta data QList("minimal")
                    qt.core.plugin.factoryloader: looking at "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/platforms/libqcocoa.dylib"
                    qt.core.plugin.loader: Found metadata in lib /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/platforms/libqcocoa.dylib, metadata=
                    {
                        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
                        "MetaData": {
                            "Keys": [
                                "cocoa"
                            ]
                        },
                        "archlevel": 0,
                        "className": "QCocoaIntegrationPlugin",
                        "debug": false,
                        "version": 394496
                    }
                    
                    
                    qt.core.plugin.factoryloader: Got keys from plugin meta data QList("cocoa")
                    qt.core.plugin.factoryloader: checking directory path "/Users/mikolajnawrocki/Documents/GitHub/build-ATLAS-Qt_6_5_0_for_macOS-Release/platforms" ...
                    qt.core.library: "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/platforms/libqcocoa.dylib" loaded library
                    qt.core.plugin.factoryloader: checking directory path "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/platformthemes" ...
                    qt.core.plugin.factoryloader: checking directory path "/Users/mikolajnawrocki/Documents/GitHub/build-ATLAS-Qt_6_5_0_for_macOS-Release/platformthemes" ...
                    qt.core.plugin.factoryloader: checking directory path "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/styles" ...
                    qt.core.plugin.factoryloader: looking at "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/styles/libqmacstyle.dylib"
                    qt.core.plugin.loader: Found metadata in lib /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/styles/libqmacstyle.dylib, metadata=
                    {
                        "IID": "org.qt-project.Qt.QStyleFactoryInterface",
                        "MetaData": {
                            "Keys": [
                                "macOS"
                            ]
                        },
                        "archlevel": 0,
                        "className": "QMacStylePlugin",
                        "debug": false,
                        "version": 394496
                    }
                    
                    
                    qt.core.plugin.factoryloader: Got keys from plugin meta data QList("macos")
                    qt.core.plugin.factoryloader: checking directory path "/Users/mikolajnawrocki/Documents/GitHub/build-ATLAS-Qt_6_5_0_for_macOS-Release/styles" ...
                    qt.core.library: "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/styles/libqmacstyle.dylib" loaded library
                    qt.qpa.fonts: Populating font family aliases took 50 ms. Replace uses of missing font family "Roboto" with one that exists to avoid this cost. 
                    qt.core.plugin.factoryloader: checking directory path "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/networkaccess" ...
                    qt.core.plugin.factoryloader: checking directory path "/Users/mikolajnawrocki/Documents/GitHub/build-ATLAS-Qt_6_5_0_for_macOS-Release/networkaccess" ...
                    qt.core.library: "resolv" loaded library
                    qt.core.plugin.factoryloader: checking directory path "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers" ...
                    qt.core.plugin.factoryloader: looking at "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/libqsqlite.dylib"
                    qt.core.plugin.loader: Found metadata in lib /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/libqsqlite.dylib, metadata=
                    {
                        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                        "MetaData": {
                            "Keys": [
                                "QSQLITE"
                            ]
                        },
                        "archlevel": 0,
                        "className": "QSQLiteDriverPlugin",
                        "debug": false,
                        "version": 394496
                    }
                    
                    
                    qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QSQLITE")
                    qt.core.plugin.factoryloader: looking at "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/libqsqlmysql.dylib"
                    qt.core.plugin.loader: Failed to find metadata in lib /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/libqsqlmysql.dylib: '/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/libqsqlmysql.dylib' is not a valid Mach-O binary (wrong architecture)
                    qt.core.plugin.factoryloader: "Failed to extract plugin meta data from '/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/libqsqlmysql.dylib': '/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/libqsqlmysql.dylib' is not a valid Mach-O binary (wrong architecture)" 
                             not a plugin
                    qt.core.plugin.factoryloader: looking at "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/libqsqlodbc.dylib"
                    qt.core.plugin.loader: Found metadata in lib /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/libqsqlodbc.dylib, metadata=
                    {
                        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                        "MetaData": {
                            "Keys": [
                                "QODBC"
                            ]
                        },
                        "archlevel": 0,
                        "className": "QODBCDriverPlugin",
                        "debug": false,
                        "version": 394496
                    }
                    
                    
                    qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QODBC")
                    qt.core.plugin.factoryloader: looking at "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/libqsqlpsql.dylib"
                    qt.core.plugin.loader: Found metadata in lib /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/libqsqlpsql.dylib, metadata=
                    {
                        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                        "MetaData": {
                            "Keys": [
                                "QPSQL"
                            ]
                        },
                        "archlevel": 0,
                        "className": "QPSQLDriverPlugin",
                        "debug": false,
                        "version": 394496
                    }
                    
                    
                    qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QPSQL")
                    qt.core.plugin.factoryloader: checking directory path "/Users/mikolajnawrocki/Documents/GitHub/build-ATLAS-Qt_6_5_0_for_macOS-Release/sqldrivers" ...
                    QSqlDatabase: QMYSQL driver not loaded
                    QSqlDatabase: available drivers: QSQLITE QODBC QPSQL
                    qt.core.plugin.factoryloader: checking directory path "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/accessible" ...
                    qt.core.plugin.factoryloader: checking directory path "/Users/mikolajnawrocki/Documents/GitHub/build-ATLAS-Qt_6_5_0_for_macOS-Release/accessible" ...
                    
                    S 1 Reply Last reply 31 May 2023, 19:41
                    0
                    • B BushyAxis793
                      31 May 2023, 15:03

                      @SGaist Ok sorry. I delete build-sqldrivers from Qt directory and build one more time on my desktop. I input QT_DEBUG_PLUGINS in my code and I got this:

                      qt.core.plugin.factoryloader: checking directory path "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/platforms" ...
                      qt.core.plugin.factoryloader: looking at "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/platforms/libqoffscreen.dylib"
                      qt.core.plugin.loader: Found metadata in lib /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/platforms/libqoffscreen.dylib, metadata=
                      {
                          "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
                          "MetaData": {
                              "Keys": [
                                  "offscreen"
                              ]
                          },
                          "archlevel": 0,
                          "className": "QOffscreenIntegrationPlugin",
                          "debug": false,
                          "version": 394496
                      }
                      
                      
                      qt.core.plugin.factoryloader: Got keys from plugin meta data QList("offscreen")
                      qt.core.plugin.factoryloader: looking at "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/platforms/libqminimal.dylib"
                      qt.core.plugin.loader: Found metadata in lib /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/platforms/libqminimal.dylib, metadata=
                      {
                          "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
                          "MetaData": {
                              "Keys": [
                                  "minimal"
                              ]
                          },
                          "archlevel": 0,
                          "className": "QMinimalIntegrationPlugin",
                          "debug": false,
                          "version": 394496
                      }
                      
                      
                      qt.core.plugin.factoryloader: Got keys from plugin meta data QList("minimal")
                      qt.core.plugin.factoryloader: looking at "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/platforms/libqcocoa.dylib"
                      qt.core.plugin.loader: Found metadata in lib /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/platforms/libqcocoa.dylib, metadata=
                      {
                          "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
                          "MetaData": {
                              "Keys": [
                                  "cocoa"
                              ]
                          },
                          "archlevel": 0,
                          "className": "QCocoaIntegrationPlugin",
                          "debug": false,
                          "version": 394496
                      }
                      
                      
                      qt.core.plugin.factoryloader: Got keys from plugin meta data QList("cocoa")
                      qt.core.plugin.factoryloader: checking directory path "/Users/mikolajnawrocki/Documents/GitHub/build-ATLAS-Qt_6_5_0_for_macOS-Release/platforms" ...
                      qt.core.library: "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/platforms/libqcocoa.dylib" loaded library
                      qt.core.plugin.factoryloader: checking directory path "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/platformthemes" ...
                      qt.core.plugin.factoryloader: checking directory path "/Users/mikolajnawrocki/Documents/GitHub/build-ATLAS-Qt_6_5_0_for_macOS-Release/platformthemes" ...
                      qt.core.plugin.factoryloader: checking directory path "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/styles" ...
                      qt.core.plugin.factoryloader: looking at "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/styles/libqmacstyle.dylib"
                      qt.core.plugin.loader: Found metadata in lib /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/styles/libqmacstyle.dylib, metadata=
                      {
                          "IID": "org.qt-project.Qt.QStyleFactoryInterface",
                          "MetaData": {
                              "Keys": [
                                  "macOS"
                              ]
                          },
                          "archlevel": 0,
                          "className": "QMacStylePlugin",
                          "debug": false,
                          "version": 394496
                      }
                      
                      
                      qt.core.plugin.factoryloader: Got keys from plugin meta data QList("macos")
                      qt.core.plugin.factoryloader: checking directory path "/Users/mikolajnawrocki/Documents/GitHub/build-ATLAS-Qt_6_5_0_for_macOS-Release/styles" ...
                      qt.core.library: "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/styles/libqmacstyle.dylib" loaded library
                      qt.qpa.fonts: Populating font family aliases took 50 ms. Replace uses of missing font family "Roboto" with one that exists to avoid this cost. 
                      qt.core.plugin.factoryloader: checking directory path "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/networkaccess" ...
                      qt.core.plugin.factoryloader: checking directory path "/Users/mikolajnawrocki/Documents/GitHub/build-ATLAS-Qt_6_5_0_for_macOS-Release/networkaccess" ...
                      qt.core.library: "resolv" loaded library
                      qt.core.plugin.factoryloader: checking directory path "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers" ...
                      qt.core.plugin.factoryloader: looking at "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/libqsqlite.dylib"
                      qt.core.plugin.loader: Found metadata in lib /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/libqsqlite.dylib, metadata=
                      {
                          "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                          "MetaData": {
                              "Keys": [
                                  "QSQLITE"
                              ]
                          },
                          "archlevel": 0,
                          "className": "QSQLiteDriverPlugin",
                          "debug": false,
                          "version": 394496
                      }
                      
                      
                      qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QSQLITE")
                      qt.core.plugin.factoryloader: looking at "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/libqsqlmysql.dylib"
                      qt.core.plugin.loader: Failed to find metadata in lib /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/libqsqlmysql.dylib: '/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/libqsqlmysql.dylib' is not a valid Mach-O binary (wrong architecture)
                      qt.core.plugin.factoryloader: "Failed to extract plugin meta data from '/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/libqsqlmysql.dylib': '/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/libqsqlmysql.dylib' is not a valid Mach-O binary (wrong architecture)" 
                               not a plugin
                      qt.core.plugin.factoryloader: looking at "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/libqsqlodbc.dylib"
                      qt.core.plugin.loader: Found metadata in lib /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/libqsqlodbc.dylib, metadata=
                      {
                          "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                          "MetaData": {
                              "Keys": [
                                  "QODBC"
                              ]
                          },
                          "archlevel": 0,
                          "className": "QODBCDriverPlugin",
                          "debug": false,
                          "version": 394496
                      }
                      
                      
                      qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QODBC")
                      qt.core.plugin.factoryloader: looking at "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/libqsqlpsql.dylib"
                      qt.core.plugin.loader: Found metadata in lib /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/libqsqlpsql.dylib, metadata=
                      {
                          "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                          "MetaData": {
                              "Keys": [
                                  "QPSQL"
                              ]
                          },
                          "archlevel": 0,
                          "className": "QPSQLDriverPlugin",
                          "debug": false,
                          "version": 394496
                      }
                      
                      
                      qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QPSQL")
                      qt.core.plugin.factoryloader: checking directory path "/Users/mikolajnawrocki/Documents/GitHub/build-ATLAS-Qt_6_5_0_for_macOS-Release/sqldrivers" ...
                      QSqlDatabase: QMYSQL driver not loaded
                      QSqlDatabase: available drivers: QSQLITE QODBC QPSQL
                      qt.core.plugin.factoryloader: checking directory path "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/accessible" ...
                      qt.core.plugin.factoryloader: checking directory path "/Users/mikolajnawrocki/Documents/GitHub/build-ATLAS-Qt_6_5_0_for_macOS-Release/accessible" ...
                      
                      S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 31 May 2023, 19:41 last edited by
                      #34

                      @BushyAxis793 check the file type and architecture of the plugin you created. There's something wrong with it.

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      B 1 Reply Last reply 1 Jun 2023, 10:24
                      1
                      • S SGaist
                        31 May 2023, 19:41

                        @BushyAxis793 check the file type and architecture of the plugin you created. There's something wrong with it.

                        B Offline
                        B Offline
                        BushyAxis793
                        wrote on 1 Jun 2023, 10:24 last edited by BushyAxis793 6 Jan 2023, 10:36
                        #35

                        @SGaist OK. I decided to delete and build plugin one more time and I still got no errors but I noticed few warnings:

                        ld: warning: dylib (/usr/local/mysql/lib/libmysqlclient.dylib) was built for newer macOS version (12.0) than being linked (11.0)
                        ld: warning: linking against a dylib which is not safe for use in application extensions: /usr/local/mysql/lib/libmysqlclient.dylib
                        

                        The file type of my libmysqlclient.dylib seems be ok and the architecture is universal (x86 + amr64) via lipo.

                        S 1 Reply Last reply 1 Jun 2023, 19:00
                        0
                        • B BushyAxis793
                          1 Jun 2023, 10:24

                          @SGaist OK. I decided to delete and build plugin one more time and I still got no errors but I noticed few warnings:

                          ld: warning: dylib (/usr/local/mysql/lib/libmysqlclient.dylib) was built for newer macOS version (12.0) than being linked (11.0)
                          ld: warning: linking against a dylib which is not safe for use in application extensions: /usr/local/mysql/lib/libmysqlclient.dylib
                          

                          The file type of my libmysqlclient.dylib seems be ok and the architecture is universal (x86 + amr64) via lipo.

                          S Offline
                          S Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on 1 Jun 2023, 19:00 last edited by
                          #36

                          What about libqsqlmysql.dylib ?

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          B 1 Reply Last reply 2 Jun 2023, 08:13
                          1
                          • S SGaist
                            1 Jun 2023, 19:00

                            What about libqsqlmysql.dylib ?

                            B Offline
                            B Offline
                            BushyAxis793
                            wrote on 2 Jun 2023, 08:13 last edited by
                            #37

                            @SGaist I checked libqsqlmysql.dylib architecture:

                            mikolajnawrocki@MacBook-Pro-Mikoaj ~ % lipo -info /Users/mikolajnawrocki/Desktop/build-sqldrivers/plugins/sqldrivers/libqsqlmysql.dylib
                            Non-fat file: /Users/mikolajnawrocki/Desktop/build-sqldrivers/plugins/sqldrivers/libqsqlmysql.dylib is architecture: x86_64
                            
                            S 1 Reply Last reply 2 Jun 2023, 20:17
                            0
                            • B BushyAxis793
                              2 Jun 2023, 08:13

                              @SGaist I checked libqsqlmysql.dylib architecture:

                              mikolajnawrocki@MacBook-Pro-Mikoaj ~ % lipo -info /Users/mikolajnawrocki/Desktop/build-sqldrivers/plugins/sqldrivers/libqsqlmysql.dylib
                              Non-fat file: /Users/mikolajnawrocki/Desktop/build-sqldrivers/plugins/sqldrivers/libqsqlmysql.dylib is architecture: x86_64
                              
                              S Offline
                              S Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on 2 Jun 2023, 20:17 last edited by
                              #38

                              Looks like it still is single architecture.

                              Interested in AI ? www.idiap.ch
                              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                              B 1 Reply Last reply 3 Jun 2023, 05:34
                              1
                              • S SGaist
                                2 Jun 2023, 20:17

                                Looks like it still is single architecture.

                                B Offline
                                B Offline
                                BushyAxis793
                                wrote on 3 Jun 2023, 05:34 last edited by
                                #39

                                @SGaist As I said before libmysqlclient.dylib is universal

                                mikolajnawrocki@MacBook-Pro-Mikoaj ~ % lipo -info /Users/mikolajnawrocki/Desktop/universal/libmysqlclient.dylib
                                Architectures in the fat file: /Users/mikolajnawrocki/Desktop/universal/libmysqlclient.dylib are: x86_64 arm64 
                                

                                So the question is why libqsqlmysql.dylib is still x86?

                                in this command

                                /Users/mikolajnawrocki/Qt/6.5.0/macos/bin/qt-cmake /Users/mikolajnawrocki/Qt/6.5.0/Src/qtbase/src/plugins/sqldrivers -DCMAKE_INSTALL_PREFIX=/Users/mikolajnawrocki/Qt/6.5.0/macos -DMySQL_INCLUDE_DIR="/usr/local/mysql/include" -DMySQL_LIBRARY="/usr/local/mysql/lib/libmysqlclient.dylib"
                                

                                libmysqlclient.dylib has correctly architecture

                                Maybe something with this warnings?

                                ld: warning: dylib (/usr/local/mysql/lib/libmysqlclient.dylib) was built for newer macOS version (12.0) than being linked (11.0)
                                ld: warning: linking against a dylib which is not safe for use in application extensions: /usr/local/mysql/lib/libmysqlclient.dylib
                                

                                I think I am very close to fix my problem but still needs some help.

                                1 Reply Last reply
                                0
                                • hskoglundH Offline
                                  hskoglundH Offline
                                  hskoglund
                                  wrote on 3 Jun 2023, 06:37 last edited by
                                  #40

                                  Hi, to be sure you build for the correct architecture, you can specify it on qt-cmake's command line, like this:

                                  /Users/mikolajnawrocki/Qt/6.5.0/macos/bin/qt-cmake /Users/mikolajnawrocki/Qt/6.5.0/Src/qtbase/src/plugins/sqldrivers -DCMAKE_INSTALL_PREFIX=/Users/mikolajnawrocki/Qt/6.5.0/macos -DMySQL_INCLUDE_DIR="/usr/local/mysql/include" -DMySQL_LIBRARY="/usr/local/mysql/lib/libmysqlclient.dylib" -DCMAKE_OSX_ARCHITECTURES="arm64" .
                                  
                                  B 1 Reply Last reply 3 Jun 2023, 07:52
                                  1
                                  • hskoglundH hskoglund
                                    3 Jun 2023, 06:37

                                    Hi, to be sure you build for the correct architecture, you can specify it on qt-cmake's command line, like this:

                                    /Users/mikolajnawrocki/Qt/6.5.0/macos/bin/qt-cmake /Users/mikolajnawrocki/Qt/6.5.0/Src/qtbase/src/plugins/sqldrivers -DCMAKE_INSTALL_PREFIX=/Users/mikolajnawrocki/Qt/6.5.0/macos -DMySQL_INCLUDE_DIR="/usr/local/mysql/include" -DMySQL_LIBRARY="/usr/local/mysql/lib/libmysqlclient.dylib" -DCMAKE_OSX_ARCHITECTURES="arm64" .
                                    
                                    B Offline
                                    B Offline
                                    BushyAxis793
                                    wrote on 3 Jun 2023, 07:52 last edited by
                                    #41

                                    @hskoglund Thanks for reply. I was follow your tip and the architecture is:

                                    mikolajnawrocki@MacBook-Pro-Mikoaj ~ % lipo -info /Users/mikolajnawrocki/Desktop/build-sqldrivers/plugins/sqldrivers/libqsqlmysql.dylib
                                    Non-fat file: /Users/mikolajnawrocki/Desktop/build-sqldrivers/plugins/sqldrivers/libqsqlmysql.dylib is architecture: x86_64
                                    
                                    1 Reply Last reply
                                    0
                                    • hskoglundH Offline
                                      hskoglundH Offline
                                      hskoglund
                                      wrote on 3 Jun 2023, 08:10 last edited by
                                      #42

                                      Hi, if you're running QT an M1 MacBook Pro then the architecture should be "arm64".

                                      B 1 Reply Last reply 3 Jun 2023, 10:11
                                      1
                                      • hskoglundH hskoglund
                                        3 Jun 2023, 08:10

                                        Hi, if you're running QT an M1 MacBook Pro then the architecture should be "arm64".

                                        B Offline
                                        B Offline
                                        BushyAxis793
                                        wrote on 3 Jun 2023, 10:11 last edited by
                                        #43

                                        @hskoglund I know but my architecture is x86_64/arm64 so I need universal plugin. No idea how to install arm only version of QT.

                                        1 Reply Last reply
                                        0
                                        • hskoglundH Offline
                                          hskoglundH Offline
                                          hskoglund
                                          wrote on 3 Jun 2023, 10:38 last edited by
                                          #44

                                          Building wrih universal architecture is a good idea if you plan to distribute the .dylib to other Mac computers, but Oracle only allows a build for a single compurer anyway:

                                          B 1 Reply Last reply 3 Jun 2023, 12:47
                                          1

                                          34/53

                                          31 May 2023, 19:41

                                          • Login

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