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
QtWS25 Last Chance

Added QMysql plugin to Qt Creator project on MacOS Ventura 13.4

Scheduled Pinned Locked Moved Solved General and Desktop
53 Posts 4 Posters 16.6k 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.
  • SGaistS SGaist

    @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 last edited by BushyAxis793
    #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.

    SGaistS 1 Reply Last reply
    0
    • B BushyAxis793

      @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.

      SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on 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
      1
      • SGaistS SGaist

        What about libqsqlmysql.dylib ?

        B Offline
        B Offline
        BushyAxis793
        wrote on 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
        
        SGaistS 1 Reply Last reply
        0
        • B BushyAxis793

          @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
          
          SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on 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
          1
          • SGaistS SGaist

            Looks like it still is single architecture.

            B Offline
            B Offline
            BushyAxis793
            wrote on 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 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
              1
              • hskoglundH hskoglund

                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 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 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
                  1
                  • hskoglundH hskoglund

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

                    B Offline
                    B Offline
                    BushyAxis793
                    wrote on 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 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
                      1
                      • hskoglundH hskoglund

                        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 Offline
                        B Offline
                        BushyAxis793
                        wrote on last edited by
                        #45

                        @hskoglund OK. So, can You tell me what is in you opinion best way to add qmysql plugin to qt creator?

                        1 Reply Last reply
                        0
                        • hskoglundH Offline
                          hskoglundH Offline
                          hskoglund
                          wrote on last edited by
                          #46

                          If you do that qt-cmake command again with the architecture specified (same as I posted 7 hours ago):

                          /Users/mikolajnawrocki/Qt/6.5.0/macos/bin/qt-cmake ... -DCMAKE_OSX_ARCHITECTURES="arm64"
                          

                          and then try the lipo command:

                          lipo -info /Users/mikolajnawrocki/Desktop/build-sqldrivers/plugins/sqldrivers/libqsqlmysql.dylib
                          

                          if it still says "x86_64" then try nuking the build directory :-)

                          B 1 Reply Last reply
                          1
                          • hskoglundH hskoglund

                            If you do that qt-cmake command again with the architecture specified (same as I posted 7 hours ago):

                            /Users/mikolajnawrocki/Qt/6.5.0/macos/bin/qt-cmake ... -DCMAKE_OSX_ARCHITECTURES="arm64"
                            

                            and then try the lipo command:

                            lipo -info /Users/mikolajnawrocki/Desktop/build-sqldrivers/plugins/sqldrivers/libqsqlmysql.dylib
                            

                            if it still says "x86_64" then try nuking the build directory :-)

                            B Offline
                            B Offline
                            BushyAxis793
                            wrote on last edited by BushyAxis793
                            #47

                            @hskoglund Same result :(

                            I have no idea why I still got x86_64 architecture...

                            All I want is just add QMySQL plugin to my Qt Creator project nothing more.

                            1 Reply Last reply
                            0
                            • hskoglundH Offline
                              hskoglundH Offline
                              hskoglund
                              wrote on last edited by
                              #48

                              The stackoverflow post you linked to 9 days ago, I looked at it now and it is a very good instruction how to build the MySQL plugin.
                              Pleas try it again and remember to erase all build directories and download a fresh copy of Qt”s sources every time you complie/build the plugin.

                              B 1 Reply Last reply
                              1
                              • hskoglundH hskoglund

                                The stackoverflow post you linked to 9 days ago, I looked at it now and it is a very good instruction how to build the MySQL plugin.
                                Pleas try it again and remember to erase all build directories and download a fresh copy of Qt”s sources every time you complie/build the plugin.

                                B Offline
                                B Offline
                                BushyAxis793
                                wrote on last edited by BushyAxis793
                                #49

                                @hskoglund I did it but when I input

                                cmake --build .
                                

                                I got:

                                [9/11] Linking CXX shared module plugins/sqldrivers/libqsqlmysql.dylib
                                FAILED: plugins/sqldrivers/libqsqlmysql.dylib 
                                : && /usr/bin/clang++ -g -DNDEBUG -O2 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -mmacosx-version-min=11.0 -bundle -Wl,-headerpad_max_install_names -Wl,-undefined,error -fapplication-extension -o plugins/sqldrivers/libqsqlmysql.dylib mysql/CMakeFiles/QMYSQLDriverPlugin.dir/QMYSQLDriverPlugin_autogen/mocs_compilation.cpp.o mysql/CMakeFiles/QMYSQLDriverPlugin.dir/main.cpp.o mysql/CMakeFiles/QMYSQLDriverPlugin.dir/qsql_mysql.cpp.o -F/Users/mikolajnawrocki/Qt/6.5.0/macos/lib -Wl,-rpath,/usr/local/mysql/lib -Wl,-rpath,/Users/mikolajnawrocki/Qt/6.5.0/macos/lib  /usr/local/mysql/lib/libmysqlclient.dylib  /Users/mikolajnawrocki/Qt/6.5.0/macos/lib/QtSql.framework/Versions/A/QtSql  /Users/mikolajnawrocki/Qt/6.5.0/macos/lib/QtCore.framework/Versions/A/QtCore  -framework IOKit  -framework DiskArbitration && cd /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/build_sqldrivers/mysql && /opt/homebrew/Cellar/cmake/3.26.4/bin/cmake -E make_directory /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/build_sqldrivers/plugins/sqldrivers/libqsqlmysql.dylib.dSYM/Contents/Resources/DWARF && /opt/homebrew/Cellar/cmake/3.26.4/bin/cmake -E copy Info.dSYM.plist /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/build_sqldrivers/plugins/sqldrivers/libqsqlmysql.dylib.dSYM/Contents/Info.plist && /usr/bin/dsymutil /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/build_sqldrivers/plugins/sqldrivers/libqsqlmysql.dylib --flat -o /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/build_sqldrivers/plugins/sqldrivers/libqsqlmysql.dylib.dSYM/Contents/Resources/DWARF/qsqlmysql && /usr/bin/strip -S /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/build_sqldrivers/plugins/sqldrivers/libqsqlmysql.dylib && chmod -x /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/build_sqldrivers/plugins/sqldrivers/libqsqlmysql.dylib.dSYM/Contents/Resources/DWARF/qsqlmysql
                                ld: warning: ignoring file /usr/local/mysql/lib/libmysqlclient.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
                                Undefined symbols for architecture x86_64:
                                  "_mysql_affected_rows", referenced from:
                                      QMYSQLResult::reset(QString const&) in qsql_mysql.cpp.o
                                      QMYSQLResult::nextResult() in qsql_mysql.cpp.o
                                  "_mysql_character_set_name", referenced from:
                                      QMYSQLDriver::open(QString const&, QString const&, QString const&, QString const&, int, QString const&) (.cold.1) in qsql_mysql.cpp.o
                                  "_mysql_close", referenced from:
                                      QMYSQLDriver::open(QString const&, QString const&, QString const&, QString const&, int, QString const&) in qsql_mysql.cpp.o
                                      QMYSQLDriver::close() in qsql_mysql.cpp.o
                                  "_mysql_data_seek", referenced from:
                                      QMYSQLResult::fetch(int) in qsql_mysql.cpp.o
                                  "_mysql_errno", referenced from:
                                      qMakeError(QString const&, QSqlError::ErrorType, QMYSQLDriverPrivate const*) in qsql_mysql.cpp.o
                                      QMYSQLResult::record() const in qsql_mysql.cpp.o
                                  "_mysql_error", referenced from:
                                      qMakeError(QString const&, QSqlError::ErrorType, QMYSQLDriverPrivate const*) in qsql_mysql.cpp.o
                                      QMYSQLDriver::open(QString const&, QString const&, QString const&, QString const&, int, QString const&) (.cold.1) in qsql_mysql.cpp.o
                                  "_mysql_fetch_field", referenced from:
                                      QMYSQLResultPrivate::bindInValues() in qsql_mysql.cpp.o
                                      QMYSQLResult::record() const in qsql_mysql.cpp.o
                                      QMYSQLDriver::record(QString const&) const in qsql_mysql.cpp.o
                                  "_mysql_fetch_field_direct", referenced from:
                                      QMYSQLResult::reset(QString const&) in qsql_mysql.cpp.o
                                      QMYSQLResult::nextResult() in qsql_mysql.cpp.o
                                  "_mysql_fetch_lengths", referenced from:
                                      QMYSQLResult::data(int) in qsql_mysql.cpp.o
                                  "_mysql_fetch_row", referenced from:
                                      QMYSQLResult::fetch(int) in qsql_mysql.cpp.o
                                      QMYSQLResult::fetchNext() in qsql_mysql.cpp.o
                                  "_mysql_field_count", referenced from:
                                      QMYSQLResult::reset(QString const&) in qsql_mysql.cpp.o
                                      QMYSQLResult::nextResult() in qsql_mysql.cpp.o
                                  "_mysql_field_seek", referenced from:
                                      QMYSQLResult::record() const in qsql_mysql.cpp.o
                                  "_mysql_free_result", referenced from:
                                      QMYSQLResult::cleanup() in qsql_mysql.cpp.o
                                      QMYSQLResult::nextResult() in qsql_mysql.cpp.o
                                      QMYSQLDriver::record(QString const&) const in qsql_mysql.cpp.o
                                  "_mysql_init", referenced from:
                                      QMYSQLDriver::open(QString const&, QString const&, QString const&, QString const&, int, QString const&) in qsql_mysql.cpp.o
                                  "_mysql_insert_id", referenced from:
                                      QMYSQLResult::lastInsertId() const in qsql_mysql.cpp.o
                                  "_mysql_list_fields", referenced from:
                                      QMYSQLDriver::record(QString const&) const in qsql_mysql.cpp.o
                                  "_mysql_next_result", referenced from:
                                      QMYSQLResult::cleanup() in qsql_mysql.cpp.o
                                      QMYSQLResult::nextResult() in qsql_mysql.cpp.o
                                  "_mysql_num_fields", referenced from:
                                      QMYSQLResultPrivate::bindInValues() in qsql_mysql.cpp.o
                                  "_mysql_num_rows", referenced from:
                                      QMYSQLResult::fetchLast() in qsql_mysql.cpp.o
                                      QMYSQLResult::size() in qsql_mysql.cpp.o
                                  "_mysql_options", referenced from:
                                      setOptionString(MYSQL*, mysql_option, QStringView) in qsql_mysql.cpp.o
                                      setOptionInt(MYSQL*, mysql_option, QStringView) in qsql_mysql.cpp.o
                                      setOptionBool(MYSQL*, mysql_option, QStringView) in qsql_mysql.cpp.o
                                  "_mysql_query", referenced from:
                                      QMYSQLDriver::beginTransaction() in qsql_mysql.cpp.o
                                      QMYSQLDriver::commitTransaction() in qsql_mysql.cpp.o
                                      QMYSQLDriver::rollbackTransaction() in qsql_mysql.cpp.o
                                  "_mysql_real_connect", referenced from:
                                      QMYSQLDriver::open(QString const&, QString const&, QString const&, QString const&, int, QString const&) in qsql_mysql.cpp.o
                                  "_mysql_real_escape_string", referenced from:
                                      QMYSQLDriver::formatValue(QSqlField const&, bool) const in qsql_mysql.cpp.o
                                  "_mysql_real_query", referenced from:
                                      QMYSQLResult::reset(QString const&) in qsql_mysql.cpp.o
                                  "_mysql_select_db", referenced from:
                                      QMYSQLDriver::open(QString const&, QString const&, QString const&, QString const&, int, QString const&) in qsql_mysql.cpp.o
                                  "_mysql_server_end", referenced from:
                                      QMYSQLDriver::~QMYSQLDriver() in qsql_mysql.cpp.o
                                      QMYSQLDriver::~QMYSQLDriver() in qsql_mysql.cpp.o
                                      QMYSQLDriver::~QMYSQLDriver() in qsql_mysql.cpp.o
                                  "_mysql_server_init", referenced from:
                                      QMYSQLDriver::QMYSQLDriver(QObject*) in qsql_mysql.cpp.o
                                      QMYSQLDriver::QMYSQLDriver(MYSQL*, QObject*) in qsql_mysql.cpp.o
                                  "_mysql_set_character_set", referenced from:
                                      QMYSQLDriver::open(QString const&, QString const&, QString const&, QString const&, int, QString const&) in qsql_mysql.cpp.o
                                  "_mysql_stmt_affected_rows", referenced from:
                                      QMYSQLResult::exec() in qsql_mysql.cpp.o
                                  "_mysql_stmt_attr_set", referenced from:
                                      QMYSQLResult::exec() in qsql_mysql.cpp.o
                                  "_mysql_stmt_bind_param", referenced from:
                                      QMYSQLResult::exec() in qsql_mysql.cpp.o
                                  "_mysql_stmt_bind_result", referenced from:
                                      QMYSQLResult::exec() in qsql_mysql.cpp.o
                                  "_mysql_stmt_close", referenced from:
                                      QMYSQLResult::cleanup() in qsql_mysql.cpp.o
                                      QMYSQLDriver::open(QString const&, QString const&, QString const&, QString const&, int, QString const&) in qsql_mysql.cpp.o
                                  "_mysql_stmt_data_seek", referenced from:
                                      QMYSQLResult::fetch(int) in qsql_mysql.cpp.o
                                  "_mysql_stmt_errno", referenced from:
                                      qMakeStmtError(QString const&, QSqlError::ErrorType, MYSQL_STMT*) in qsql_mysql.cpp.o
                                  "_mysql_stmt_error", referenced from:
                                      qMakeStmtError(QString const&, QSqlError::ErrorType, MYSQL_STMT*) in qsql_mysql.cpp.o
                                  "_mysql_stmt_execute", referenced from:
                                      QMYSQLResult::exec() in qsql_mysql.cpp.o
                                  "_mysql_stmt_fetch", referenced from:
                                      QMYSQLResult::fetch(int) in qsql_mysql.cpp.o
                                      QMYSQLResult::fetchNext() in qsql_mysql.cpp.o
                                  "_mysql_stmt_free_result", referenced from:
                                      QMYSQLResult::detachFromResultSet() in qsql_mysql.cpp.o
                                  "_mysql_stmt_init", referenced from:
                                      QMYSQLResult::prepare(QString const&) in qsql_mysql.cpp.o
                                      QMYSQLDriver::open(QString const&, QString const&, QString const&, QString const&, int, QString const&) in qsql_mysql.cpp.o
                                  "_mysql_stmt_insert_id", referenced from:
                                      QMYSQLResult::lastInsertId() const in qsql_mysql.cpp.o
                                  "_mysql_stmt_num_rows", referenced from:
                                      QMYSQLResult::fetchLast() in qsql_mysql.cpp.o
                                      QMYSQLResult::size() in qsql_mysql.cpp.o
                                  "_mysql_stmt_param_count", referenced from:
                                      QMYSQLResult::prepare(QString const&) in qsql_mysql.cpp.o
                                      QMYSQLResult::exec() in qsql_mysql.cpp.o
                                      QMYSQLDriver::open(QString const&, QString const&, QString const&, QString const&, int, QString const&) in qsql_mysql.cpp.o
                                  "_mysql_stmt_prepare", referenced from:
                                      QMYSQLResult::prepare(QString const&) in qsql_mysql.cpp.o
                                      QMYSQLDriver::open(QString const&, QString const&, QString const&, QString const&, int, QString const&) in qsql_mysql.cpp.o
                                  "_mysql_stmt_reset", referenced from:
                                      QMYSQLResult::exec() in qsql_mysql.cpp.o
                                  "_mysql_stmt_result_metadata", referenced from:
                                      QMYSQLResultPrivate::bindInValues() in qsql_mysql.cpp.o
                                  "_mysql_stmt_store_result", referenced from:
                                      QMYSQLResult::exec() in qsql_mysql.cpp.o
                                  "_mysql_store_result", referenced from:
                                      QMYSQLResult::cleanup() in qsql_mysql.cpp.o
                                      QMYSQLResult::reset(QString const&) in qsql_mysql.cpp.o
                                      QMYSQLResult::nextResult() in qsql_mysql.cpp.o
                                  "_mysql_thread_end", referenced from:
                                      QMYSQLDriver::close() in qsql_mysql.cpp.o
                                  "_mysql_thread_init", referenced from:
                                      QMYSQLDriver::open(QString const&, QString const&, QString const&, QString const&, int, QString const&) in qsql_mysql.cpp.o
                                ld: symbol(s) not found for architecture x86_64
                                clang: error: linker command failed with exit code 1 (use -v to see invocation)
                                [10/11] Building C object sqlite/CMakeFiles/QSQLit...t/6.5.0/Src/qtbase/src/3rdparty/sqlite/sqlite3.c.o
                                ninja: build stopped: subcommand failed.
                                

                                What now?

                                1 Reply Last reply
                                0
                                • hskoglundH Offline
                                  hskoglundH Offline
                                  hskoglund
                                  wrote on last edited by
                                  #50

                                  You got to step 7 ok in that post https://stackoverflow.com/questions/73908494/qmysql-driver-not-loaded-on-mac-os-for-mac-m1-m2-users/73908495 but in step 8 you forgot to type:
                                  -DCMAKE_OSX_ARCHITECTURES="arm64"

                                  Remember to erase the build folders and download a fresh copy of Qt's sources before building again :-)

                                  B 1 Reply Last reply
                                  3
                                  • hskoglundH hskoglund

                                    You got to step 7 ok in that post https://stackoverflow.com/questions/73908494/qmysql-driver-not-loaded-on-mac-os-for-mac-m1-m2-users/73908495 but in step 8 you forgot to type:
                                    -DCMAKE_OSX_ARCHITECTURES="arm64"

                                    Remember to erase the build folders and download a fresh copy of Qt's sources before building again :-)

                                    B Offline
                                    B Offline
                                    BushyAxis793
                                    wrote on last edited by BushyAxis793
                                    #51

                                    @hskoglund Ok so I remove and Install again Sources and delete build_sqldriverrs folder to.

                                    1. I installed ninja with homebrew

                                    2. I go to

                                    cd /Users/mikolajnawrocki/Qt/6.5.0/Src
                                    
                                    1. I Input
                                    ./configure -sql-mysql -- -DCMAKE_INCLUDE_PATH="/usr/local/mysql/include" -DCMAKE_LIBRARY_PATH="/usr/local/mysql/lib"
                                    
                                    1. Then I go to
                                     cd /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers
                                    
                                    

                                    and Input

                                    mikolajnawrocki@MacBook-Pro-Mikoaj sqldrivers % mkdir build_sqldrivers
                                    mikolajnawrocki@MacBook-Pro-Mikoaj sqldrivers % cd build_sqldrivers
                                    
                                    1. Next I Input
                                    /Users/mikolajnawrocki/Qt/6.5.0/macos/bin/qt-cmake -G Ninja  /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"
                                    
                                    1. Then I input
                                    sed -i -e 's/-arch x86_64/-arch arm64/g' /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/build_sqldrivers/build.ninja
                                    
                                    1. Next I input
                                    cmake --build .
                                    
                                    1. Then I input
                                    cmake --install .
                                    

                                    at the end I copy libqsqlmysql.dylib from build_sqldrivers to sqldrivers.

                                    Everything seems be ok. But when I open my project I got below errors

                                    13:02:57: Starting /Users/mikolajnawrocki/Documents/GitHub/build-ATLAS-Qt_6_5_0_for_macOS-Release/ATLAS...
                                    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 54 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: Found metadata in lib /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/libqsqlmysql.dylib, metadata=
                                    {
                                        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
                                        "MetaData": {
                                            "Keys": [
                                                "QMYSQL",
                                                "QMARIADB"
                                            ]
                                        },
                                        "archlevel": 0,
                                        "className": "QMYSQLDriverPlugin",
                                        "debug": false,
                                        "version": 394496
                                    }
                                    
                                    
                                    qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QMYSQL", "QMARIADB")
                                    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" ...
                                    qt.core.library: "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/sqldrivers/libqsqlmysql.dylib" loaded library
                                    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" ...
                                    QJsonValue(double, 4.1903)
                                    QJsonValue(double, 4.6332)
                                    QJsonValue(double, 4.5148)
                                    QJsonValue(double, 4.5148)
                                    QJsonValue(double, 5.2543)
                                    QSqlQuery::prepare: database not open
                                    QSqlError("", "", "")
                                    qt.core.plugin.factoryloader: checking directory path "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/iconengines" ...
                                    qt.core.plugin.factoryloader: looking at "/Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/iconengines/libqsvgicon.dylib"
                                    qt.core.plugin.loader: Found metadata in lib /Users/mikolajnawrocki/Qt/6.5.0/macos/plugins/iconengines/libqsvgicon.dylib, metadata=
                                    {
                                        "IID": "org.qt-project.Qt.QIconEngineFactoryInterface",
                                        "MetaData": {
                                            "Keys": [
                                                "svg",
                                                "svgz",
                                                "svg.gz"
                                            ]
                                        },
                                        "archlevel": 0,
                                        "className": "QSvgIconPlugin",
                                        "debug": false,
                                        "version": 394496
                                    }
                                    
                                    
                                    qt.core.plugin.factoryloader: Got keys from plugin meta data QList("svg", "svgz", "svg.gz")
                                    qt.core.plugin.factoryloader: checking directory path "/Users/mikolajnawrocki/Documents/GitHub/build-ATLAS-Qt_6_5_0_for_macOS-Release/iconengines" ...
                                    qt.core.library: "resolv" unloaded library 
                                    13:03:47: /Users/mikolajnawrocki/Documents/GitHub/build-ATLAS-Qt_6_5_0_for_macOS-Release/ATLAS crashed.
                                    1 Reply Last reply
                                    0
                                    • hskoglundH Offline
                                      hskoglundH Offline
                                      hskoglund
                                      wrote on last edited by
                                      #52

                                      The crash occurs 50 seconds after you started your app so I'm guessing it is unrelated to loading the MySQL plugin.

                                      So that means you've managed to build the MySQL pliugin, nice!

                                      B 1 Reply Last reply
                                      2
                                      • hskoglundH hskoglund

                                        The crash occurs 50 seconds after you started your app so I'm guessing it is unrelated to loading the MySQL plugin.

                                        So that means you've managed to build the MySQL pliugin, nice!

                                        B Offline
                                        B Offline
                                        BushyAxis793
                                        wrote on last edited by
                                        #53

                                        @hskoglund It seems I got QMySQL plugin added to Qt Creator!

                                        Thanks a lot everyone! @Christian-Ehrlicher @hskoglund @SGaist

                                        However now I have new problem. But I think I should create new topic for this. Anyway thank you very much and have a great day!

                                        1 Reply Last reply
                                        0
                                        • B BushyAxis793 has marked this topic as solved on

                                        • Login

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