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. Set-up MariaDB library file location programmatically?
QtWS25 Last Chance

Set-up MariaDB library file location programmatically?

Scheduled Pinned Locked Moved Solved General and Desktop
85 Posts 7 Posters 34.4k 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 Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #81

    This is the real error:

    @SPlatten said in Set-up MariaDB library file location programmatically?:

    Undefined symbols for architecture x86_64:

    "_mysql_get_client_version"

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

    SPlattenS 1 Reply Last reply
    0
    • SGaistS SGaist

      This is the real error:

      @SPlatten said in Set-up MariaDB library file location programmatically?:

      Undefined symbols for architecture x86_64:

      "_mysql_get_client_version"

      SPlattenS Offline
      SPlattenS Offline
      SPlatten
      wrote on last edited by SPlatten
      #82

      @SGaist , After seeing the output and its recommendation I edited sqldrivers.pro and added:

      TEMPLATE = subdirs
        
      sqldrivers_standalone {
          _QMAKE_CACHE_ = $$shadowed($$SQLDRV_SRC_TREE)/.qmake.conf
          load(qt_configure)
      }
      
      qtConfig(sql-psql)     : SUBDIRS += psql
      qtConfig(sql-mysql)    : SUBDIRS += mysql
      qtConfig(sql-odbc)     : SUBDIRS += odbc
      qtConfig(sql-tds)      : SUBDIRS += tds
      qtConfig(sql-oci)      : SUBDIRS += oci
      qtConfig(sql-db2)      : SUBDIRS += db2
      qtConfig(sql-sqlite)   : SUBDIRS += sqlite
      qtConfig(sql-sqlite2)  : SUBDIRS += sqlite2
      qtConfig(sql-ibase)    : SUBDIRS += ibase
      
      CONFIG+=sdk_no_version_check
      

      I then removed all the config files including the cache with:

      rm -R config.*
      

      Then executed:

      $QTDIRBIN/qmake -- MYSQL_INCDIR="/usr/local/Cellar/mariadb/10.5.7/include/mysql" "MYSQL_LIBDIR=/usr/local/Cellar/mariadb/10.5.7/lib" MYSQL_LIBS="-lmariadb"
      

      All this as in:

      /Users/sy/Qt/5.15.1/Src/qtbase/src/plugins/sqldrivers
      

      The result was config.log:

      
      Running configuration tests...
      Checking for DB2 (IBM)... no
      Checking for InterBase... no
      Checking for MySQL... no
      Checking for OCI (Oracle)... no
      Checking for ODBC... no
      Checking for PostgreSQL... no
      Checking for SQLite (version 2)... no
      Checking for TDS (Sybase)... no
      Done running configuration tests.
      
      Configure summary:
      
      Qt Sql Drivers:
        DB2 (IBM) .............................. no
        InterBase .............................. no
        MySql .................................. no
        OCI (Oracle) ........................... no
        ODBC ................................... no
        PostgreSQL ............................. no
        SQLite2 ................................ no
        SQLite ................................. yes
          Using system provided SQLite ......... no
        TDS (Sybase) ........................... no
      
      Qt is now configured for building. Just run 'make'.
      Once everything is built, you must run 'make install'.
      Qt will be installed into '/Users/sy/Qt/5.15.1/clang_64'.
      
      Prior to reconfiguration, make sure you remove any leftovers from
      the previous build.
      

      I then executed make:

      cd sqlite/ && ( test -e Makefile || /Users/sy/Qt/5.15.1/clang_64/bin/qmake -o Makefile /Users/sy/Qt/5.15.1/Src/qtbase/src/plugins/sqldrivers/sqlite/sqlite.pro ) && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile 
      make[1]: Nothing to be done for `first'.
      

      Then make install:

      cd sqlite/ && ( test -e Makefile || /Users/sy/Qt/5.15.1/clang_64/bin/qmake -o Makefile /Users/sy/Qt/5.15.1/Src/qtbase/src/plugins/sqldrivers/sqlite/sqlite.pro ) && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile install
      /Users/sy/Qt/5.15.1/clang_64/bin/qmake -install qinstall -exe ../plugins/sqldrivers/libqsqlite.dylib /Users/sy/Qt/5.15.1/clang_64/plugins/sqldrivers/libqsqlite.dylib
      /Users/sy/Qt/5.15.1/clang_64/bin/qmake -install qinstall /Users/sy/Qt/5.15.1/Src/qtbase/src/plugins/sqldrivers/plugins/sqldrivers/libqsqlite.dylib.dSYM/Contents/Info.plist /Users/sy/Qt/5.15.1/clang_64/plugins/sqldrivers/libqsqlite.dylib.dSYM/Contents/Info.plist
      /Users/sy/Qt/5.15.1/clang_64/bin/qmake -install qinstall /Users/sy/Qt/5.15.1/Src/qtbase/src/plugins/sqldrivers/plugins/sqldrivers/libqsqlite.dylib.dSYM/Contents/Resources/DWARF/libqsqlite.dylib /Users/sy/Qt/5.15.1/clang_64/plugins/sqldrivers/libqsqlite.dylib.dSYM/Contents/Resources/DWARF/libqsqlite.dylib
      /Users/sy/Qt/5.15.1/clang_64/bin/qmake -install qinstall /Users/sy/Qt/5.15.1/Src/qtbase/src/plugins/sqldrivers/lib/cmake/Qt5Sql/Qt5Sql_QSQLiteDriverPlugin.cmake /Users/sy/Qt/5.15.1/clang_64/lib/cmake/Qt5Sql/Qt5Sql_QSQLiteDriverPlugin.cmake
      

      I've also tried to mysql.pro:

      CONFIG+=sdk_no_version_check
        
      TARGET = qsqlmysql
      
      HEADERS += $$PWD/qsql_mysql_p.h
      SOURCES += $$PWD/qsql_mysql.cpp $$PWD/main.cpp
      
      QMAKE_USE += mysql
      
      OTHER_FILES += mysql.json
      
      PLUGIN_CLASS_NAME = QMYSQLDriverPlugin
      include(../qsqldriverbase.pri)
      

      Then repeated the above steps, still mysql shows no??? and same results. Is it looking for a mysql library because MariaDB mostly uses the name mysql as it is based on that but I've notice that there are a few folders where the name is actually mairadb and not mysql?

      Kind Regards,
      Sy

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

        Serious question: do you realise that you just silenced a warning unrelated to the actual error ?

        I already pointed you to the real issue: a symbol is missing: _mysql_get_client_version.

        In any case, Qt 5.15.2, MariaDB 10.5.8 is a working combo using the same qmake line you have with just the versions updated.

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

        SPlattenS 2 Replies Last reply
        1
        • SGaistS SGaist

          Serious question: do you realise that you just silenced a warning unrelated to the actual error ?

          I already pointed you to the real issue: a symbol is missing: _mysql_get_client_version.

          In any case, Qt 5.15.2, MariaDB 10.5.8 is a working combo using the same qmake line you have with just the versions updated.

          SPlattenS Offline
          SPlattenS Offline
          SPlatten
          wrote on last edited by
          #84

          @SGaist , I have to switch back to 5.15.1 as 5.15.2 didn't come with any binaries, such as qmake.

          Why is the symbol missing: _mysql_get_client_version ?

          I'll try updating MariaDB now.

          Kind Regards,
          Sy

          1 Reply Last reply
          0
          • SGaistS SGaist

            Serious question: do you realise that you just silenced a warning unrelated to the actual error ?

            I already pointed you to the real issue: a symbol is missing: _mysql_get_client_version.

            In any case, Qt 5.15.2, MariaDB 10.5.8 is a working combo using the same qmake line you have with just the versions updated.

            SPlattenS Offline
            SPlattenS Offline
            SPlatten
            wrote on last edited by
            #85

            @SGaist , sorted now....I didn't realise that the version of MariaDB had already been updated on my system, so after correcting this in the command line everything is now working.

            Thank you.

            Kind Regards,
            Sy

            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