Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. French
  4. Problème d'installation du driver QMySql
Forum Updated to NodeBB v4.3 + New Features

Problème d'installation du driver QMySql

Scheduled Pinned Locked Moved Solved French
27 Posts 3 Posters 3.9k 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.
  • hskoglundH Offline
    hskoglundH Offline
    hskoglund
    wrote on last edited by
    #4

    No worries, the file should be there somewhere, also try looking in:
    /Users/kallemand/Documents/build-sqldrivers2/plugins/sqldrivers

    1 Reply Last reply
    0
    • imZedkaI Offline
      imZedkaI Offline
      imZedka
      wrote on last edited by
      #5

      This path doesn't exist actually lol

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

        Well it was a nice try! The find command in Terminal should help:
        find /Users -name libqsqlmysql.dylib

        1 Reply Last reply
        0
        • imZedkaI Offline
          imZedkaI Offline
          imZedka
          wrote on last edited by
          #7

          Omg you are so good lol
          I found that
          888aa747-adf8-4cdc-bfa4-35cab99ba14d-image.png

          So I imagine I have to do a copy in the repository
          "/Users/kallemand/Qt/6.2.3/macos/plugins/sqldrivers" right ?

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

            Yessir (you only have to copy the .dylib file)

            M 1 Reply Last reply
            0
            • imZedkaI Offline
              imZedkaI Offline
              imZedka
              wrote on last edited by
              #9

              Ok, it seems to work, when i launch a program there is no more the message that QMySql is not available.
              Thank you so much dude and have a good evening

              1 Reply Last reply
              0
              • hskoglundH hskoglund

                Yessir (you only have to copy the .dylib file)

                M Offline
                M Offline
                melvin_vga
                wrote on last edited by melvin_vga
                #10

                @hskoglund hi dude, I'm sorry to disturb you.
                do you have any idea why qt-cmake is not working ?

                Screenshot 2022-03-14 at 20.00.40.png

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

                  Usually qt-cmake is not in your PATH so you need to prefix it with the directory:
                  /Users/melvin_vga/Qt/6.2.3/macos/bin/qt-cmake

                  1 Reply Last reply
                  1
                  • M Offline
                    M Offline
                    melvin_vga
                    wrote on last edited by
                    #12

                    a big thank, you really are a really great help
                    now I have another problem with the build doesn’t end (story for copy this big block) :

                    melvin_vga@melvins-macbook-pro build-sqldrivers % cmake --build .
                    [8/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/MacOSX12.1.sdk -mmacosx-version-min=10.14 -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 -Wl,-rpath,/usr/local/mysql/lib -Wl,-rpath,/Users/melvin_vga/Qt/6.2.3/macos/lib /usr/local/mysql/lib/libmysqlclient.dylib /Users/melvin_vga/Qt/6.2.3/macos/lib/QtSql.framework/Versions/A/QtSql /Users/melvin_vga/Qt/6.2.3/macos/lib/QtCore.framework/Versions/A/QtCore -framework DiskArbitration -framework IOKit && cd /Users/melvin_vga/build-sqldrivers/mysql && /opt/homebrew/Cellar/cmake/3.22.3/bin/cmake -E make_directory /Users/melvin_vga/build-sqldrivers/plugins/sqldrivers/libqsqlmysql.dylib.dSYM/Contents/Resources/DWARF && /opt/homebrew/Cellar/cmake/3.22.3/bin/cmake -E copy Info.dSYM.plist /Users/melvin_vga/build-sqldrivers/plugins/sqldrivers/libqsqlmysql.dylib.dSYM/Contents/Info.plist && /usr/bin/dsymutil /Users/melvin_vga/build-sqldrivers/plugins/sqldrivers/libqsqlmysql.dylib --flat -o /Users/melvin_vga/build-sqldrivers/plugins/sqldrivers/libqsqlmysql.dylib.dSYM/Contents/Resources/DWARF/qsqlmysql && /usr/bin/strip -S /Users/melvin_vga/build-sqldrivers/plugins/sqldrivers/libqsqlmysql.dylib && chmod -x /Users/melvin_vga/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:
                    QMYSQLDriver::open(QString const&, QString const&, QString const&, QString const&, int, QString const&) 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_ssl_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/QSQLiteDriverPlugin.dir/Users/melvin_vga/Qt/6.2.3/Src/qtbase/src/3rdparty/sqlite/sqlite3.c.o
                    ninja: build stopped: subcommand failed.

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

                      Hi, every program from Apple like Xcode etc. or Qt Creator or iQt 6.2.3 (installed by the MaintenanceTool) can be run both on an old Intel-based Apple PC or a new ARM-based M1 or M2 Apple PC, since they are universal binaries, you can check it with the file command, for example try it on the SQLite dylib which MaintenanceTool installs for you):
                      file ~/Qt/6.2.3/macos/plugins/sqldrivers/libqsqlite.dylib

                      But Homebrew does not like this idea so you have to be careful on which type of Apple PC you install MySQL on. You get a linker error because MySQL from Homebrew seems built only for arm64 (M1 or M2 PCs) but you are building the libqmysql.dylib plugin for an x86_64 Intel Apple PC.

                      If you want to build the plugin for an arm64 Apple PC you can try to override it in your qt-cmake command with a CMAKE_OSX_ARCHITECTURES #define:
                      qt-cmake /Users/<user>/Qt/6.2.3/Src/qtbase/src/plugins/sqldrivers -DCMAKE_INSTALL_PREFIX=/Users/<user>/Qt/6.2.3/macos -DMySQL_INCLUDE_DIR="/usr/local/mysql/include" -DMySQL_LIBRARY="/usr/local/mysql/lib/libmysqlclient.dylib" -DCMAKE_OSX_ARCHITECTURES="arm64"

                      1 Reply Last reply
                      1
                      • M Offline
                        M Offline
                        melvin_vga
                        wrote on last edited by
                        #14

                        Hello, thank you again for your reply. I tried this command :

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

                        I don't think there was a problem, but I prefer to show it :

                        -- The CXX compiler identification is AppleClang 13.0.0.13000029
                        -- The C compiler identification is AppleClang 13.0.0.13000029
                        -- The ASM compiler identification is Clang with GNU-like command-line
                        -- Found assembler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
                        -- Detecting CXX compiler ABI info
                        -- Detecting CXX compiler ABI info - done
                        -- Check for working CXX compiler: /usr/bin/clang++ - skipped
                        -- Detecting CXX compile features
                        -- Detecting CXX compile features - done
                        -- Detecting C compiler ABI info
                        -- Detecting C compiler ABI info - done
                        -- Check for working C compiler: /usr/bin/clang - skipped
                        -- Detecting C compile features
                        -- Detecting C compile features - done
                        -- Looking for pthread.h
                        -- Looking for pthread.h - found
                        -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
                        -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
                        -- Found Threads: TRUE  
                        -- Performing Test HAVE_STDATOMIC
                        -- Performing Test HAVE_STDATOMIC - Success
                        -- Found WrapAtomic: TRUE  
                        -- Check for feature set changes
                        -- Looking for a OBJC compiler
                        -- Looking for a OBJC compiler - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
                        -- The OBJC compiler identification is AppleClang 13.0.0.13000029
                        -- Detecting OBJC compiler ABI info
                        -- Detecting OBJC compiler ABI info - done
                        -- Check for working OBJC compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - skipped
                        -- Looking for a OBJCXX compiler
                        -- Looking for a OBJCXX compiler - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
                        -- The OBJCXX compiler identification is AppleClang 13.0.0.13000029
                        -- Detecting OBJCXX compiler ABI info
                        -- Detecting OBJCXX compiler ABI info - done
                        -- Check for working OBJCXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ - skipped
                        -- Could NOT find DB2 (missing: DB2_INCLUDE_DIR DB2_LIBRARY) 
                        -- Found MySQL: /usr/local/mysql/lib/libmysqlclient.dylib  
                        -- Could NOT find PostgreSQL (missing: PostgreSQL_LIBRARY PostgreSQL_INCLUDE_DIR) 
                        -- Could NOT find Oracle (missing: Oracle_LIBRARY Oracle_INCLUDE_DIR) 
                        -- Could NOT find ODBC (missing: ODBC_INCLUDE_DIR) 
                        -- Found SQLite3: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include (found version "3.36.0") 
                        -- Could NOT find Interbase (missing: Interbase_LIBRARY Interbase_INCLUDE_DIR) 
                        -- Performing Test HAVE_DASH_UNDEFINED_SYMBOLS
                        -- Performing Test HAVE_DASH_UNDEFINED_SYMBOLS - Success
                        -- Performing Test HAVE_DASH_DASH_NO_UNDEFINED
                        -- Performing Test HAVE_DASH_DASH_NO_UNDEFINED - Failed
                        -- The following packages have been found:
                        
                         * Qt6BuildInternals (required version >= 6.2.3)
                         * Qt6CoreTools (required version >= 6.2.3)
                         * Qt6Core (required version >= 6.2.3)
                         * Qt6Sql (required version >= 6.2.3)
                         * Qt6 (required version >= 6.2.3)
                         * MySQL, MySQL client library, <https://www.mysql.com>
                         * SQLite3
                        
                        -- The following OPTIONAL packages have not been found:
                        
                         * DB2, IBM DB2 client library, <https://www.ibm.com>
                         * PkgConfig
                         * PostgreSQL
                         * Oracle, Oracle client library, <https://www.oracle.com>
                         * ODBC
                         * Interbase, Interbase client library, <https://www.embarcadero.com/products/interbase>
                        
                        Configure summary:
                        
                        Qt Sql Drivers:
                          DB2 (IBM) .............................. no
                          InterBase .............................. no
                          MySql .................................. yes
                          OCI (Oracle) ........................... no
                          ODBC ................................... no
                          PostgreSQL ............................. no
                          SQLite ................................. yes
                            Using system provided SQLite ......... no
                        
                        -- Configuring done
                        -- Generating done
                        -- Build files have been written to: /Users/melvin_vga/build-sqldrivers
                        

                        Then I build with :

                        cmake --build .
                        

                        And the build didn't work :

                        [  9%] Automatic MOC for target QMYSQLDriverPlugin
                        [  9%] Built target QMYSQLDriverPlugin_autogen
                        [ 18%] Building CXX object mysql/CMakeFiles/QMYSQLDriverPlugin.dir/QMYSQLDriverPlugin_autogen/mocs_compilation.cpp.o
                        [ 27%] Building CXX object mysql/CMakeFiles/QMYSQLDriverPlugin.dir/main.cpp.o
                        [ 36%] Building CXX object mysql/CMakeFiles/QMYSQLDriverPlugin.dir/qsql_mysql.cpp.o
                        [ 45%] Linking CXX shared module ../plugins/sqldrivers/libqsqlmysql.dylib
                        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:
                              QMYSQLDriver::open(QString const&, QString const&, QString const&, QString const&, int, QString const&) 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_ssl_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)
                        make[2]: *** [plugins/sqldrivers/libqsqlmysql.dylib] Error 1
                        make[1]: *** [mysql/CMakeFiles/QMYSQLDriverPlugin.dir/all] Error 2
                        make: *** [all] Error 2
                        
                        1 Reply Last reply
                        0
                        • hskoglundH Offline
                          hskoglundH Offline
                          hskoglund
                          wrote on last edited by
                          #15

                          Hi, you still get the same error, most likely because of the cmake cache.
                          Try nuking (erasing) the build directory sqldrivers in Users/melvin_vga/Qt/6.2.3/Src/qtbase/src/plugins/ (easiest might be to download the Qt 6.2.3 source again).

                          1 Reply Last reply
                          1
                          • M Offline
                            M Offline
                            melvin_vga
                            wrote on last edited by
                            #16

                            I uninstalled version 6.2.3 using the maintenance tool and I reinstalled it but it gives me the same errors after redoing the qtcmake and the build

                            1 Reply Last reply
                            0
                            • hskoglundH Offline
                              hskoglundH Offline
                              hskoglund
                              wrote on last edited by
                              #17
                              This post is deleted!
                              1 Reply Last reply
                              0
                              • hskoglundH Offline
                                hskoglundH Offline
                                hskoglund
                                wrote on last edited by hskoglund
                                #18

                                I think I've found the answer, first, while -DCMAKE_OSX_ARCHITECTURES=arm64 works fine for building the sqllite and odbc plugins, it does not work for mysql :-(

                                Instead, you'll have to edit the link.txt command file manually.
                                So new instructions are:

                                1. Do the vanilla qt-cmake build command: /Users/melvin_vga/Qt/6.2.3/macos/bin/qt-cmake /Users/melvin_vga/Qt/6.2.3/Src/qtbase/src/plugins/sqldrivers -DCMAKE_INSTALL_PREFIX=/Users/melvin_vga/Qt/6.2.3/macos -DMySQL_INCLUDE_DIR="/usr/local/mysql/include" -DMySQL_LIBRARY="/usr/local/mysql/lib/libmysqlclient.dylib"
                                1. Go into the directory /Users/melvin_vga/Qt/6.2.3/Src/qtbase/src/plugins/sqldrivers/mysql/CMakeFiles/QMYSQLDriverPlugin.dir and look for a file called link.txt
                                  it should consist of one line beginning with:
                                /usr/bin/clang++ -g -DNDEBUG -O2 -arch x86_64 -isysroot /Applications/Xcode.app/Conten...
                                

                                change x86_64 to arm64 like so:

                                /usr/bin/clang++ -g -DNDEBUG -O2 -arch arm64 -isysroot /Applications/Xcode.app/Conten...
                                

                                then try the cmake --build . again

                                1 Reply Last reply
                                1
                                • M Offline
                                  M Offline
                                  melvin_vga
                                  wrote on last edited by
                                  #19

                                  I don't have a file name CMakeFiles in :

                                  /Users/melvin_vga/Qt/6.2.3/Src/qtbase/src/plugins/sqldrivers/mysql
                                  

                                  Screenshot 2022-03-15 at 20.32.50.png

                                  hskoglundH 1 Reply Last reply
                                  0
                                  • M melvin_vga

                                    I don't have a file name CMakeFiles in :

                                    /Users/melvin_vga/Qt/6.2.3/Src/qtbase/src/plugins/sqldrivers/mysql
                                    

                                    Screenshot 2022-03-15 at 20.32.50.png

                                    hskoglundH Offline
                                    hskoglundH Offline
                                    hskoglund
                                    wrote on last edited by hskoglund
                                    #20

                                    CMakeFiles is not a file, it's a subdirectory
                                    Note I edited my post above, I think it suffices that you edit the link.txt file

                                    1 Reply Last reply
                                    0
                                    • M Offline
                                      M Offline
                                      melvin_vga
                                      wrote on last edited by
                                      #21

                                      As you can see from the screenshot I posted above, I don't have the subdirectory named CMakeFiles in "mysql" and therefore not the link.txt in qt but it is in the build-sqldrivers after typing the command.

                                      I still tried to make the changes in the link.txt of build-sqldrivers with arm and this gives this build which seems normal to me since I did not make any changes in the QT folder :

                                      Screenshot 2022-03-15 at 23.01.40.png

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

                                        Nice, now cmake does not complain about linking with Homebrew's MySQL client (link.txt is ok with "... -arch arm64...")

                                        One final step: fixing the 3 .o files so that they are built for arm64 (and not x86_64):
                                        Go to the same directory as when you edited the link.txt file:
                                        /Users/melvin_vga/Qt/6.2.3/Src/qtbase/src/plugins/sqldrivers/mysql/CMakeFiles/QMYSQLDriverPlugin.dir and look for a file called flags.make
                                        It should have 11 lines (the first one says "DO NOT EDIT" we will do it anyway :-)
                                        The last line in the file should begin with:

                                        CXX_FLAGS = -g -DNDEBUG -O2 -arch x86_64 -isysroot /Applications/Xcode.app/Conten...
                                        

                                        change x86_64 to arm64:

                                        CXX_FLAGS = -g -DNDEBUG -O2 -arch arm64 -isysroot /Applications/Xcode.app/Conten...
                                        

                                        then try the cmake --build . again

                                        1 Reply Last reply
                                        1
                                        • M Offline
                                          M Offline
                                          melvin_vga
                                          wrote on last edited by
                                          #23

                                          Is this message good ?Screenshot 2022-03-16 at 10.37.32.png

                                          1 Reply Last reply
                                          0

                                          • Login

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