Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Forum Updated on Feb 6th

    Unsolved Qt 5.15 mysql plugin on Debian 10

    General and Desktop
    4
    9
    279
    Loading More Posts
    • 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.
    • L
      luca last edited by

      Hi all,
      I just installed Qt 5.15 on my debian 10 machine and I need to build mysql plugin.
      It seems I can't build plugin and I don't know why.
      I'm following https://doc.qt.io/qt-5/sql-driver.html but I'm continuing to receive:

      Project ERROR: Library 'mysql' is not defined.

      Where do I wrong?
      I compiled in the past mysql plugin on previous debian version.

      Thanks

      Ketan__Patel__0011 1 Reply Last reply Reply Quote 0
      • Ketan__Patel__0011
        Ketan__Patel__0011 @luca last edited by

        @luca

        Hi

        i have solution for it
        open the terminal and run following command

        sudo apt-get install libqt5sql5-mysql

        L 1 Reply Last reply Reply Quote 2
        • SGaist
          SGaist Lifetime Qt Champion last edited by

          Hi,

          What sources are you using to build the plugin ?
          If not a new one, did you clean it up before starting the new build ?

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

          L 1 Reply Last reply Reply Quote 0
          • L
            luca @Ketan__Patel__0011 last edited by

            @Ketan__Patel__0011 Thanks but I need to compile it, not to use a built version.

            1 Reply Last reply Reply Quote 0
            • L
              luca @SGaist last edited by luca

              @SGaist
              I'm using Qt 5.15.0 source.
              Is there some compatibility version to be used for mariadb/mysql dev libraries?

              1 Reply Last reply Reply Quote 0
              • L
                luca last edited by

                OK, I just tried from tar.gz source and now it seems I can build MySql plugin:

                Qt Sql Drivers:
                  DB2 (IBM) .............................. no
                  InterBase .............................. no
                  MySql .................................. yes
                  OCI (Oracle) ........................... no
                  ODBC ................................... no
                  PostgreSQL ............................. no
                  SQLite2 ................................ no
                  SQLite ................................. yes
                    Using system provided SQLite ......... no
                  TDS (Sybase) ........................... no
                
                

                I had problem using Src dir inside Qt installed using online installer....

                What should be the reason?

                1 Reply Last reply Reply Quote 0
                • SGaist
                  SGaist Lifetime Qt Champion last edited by

                  Without checking the test logs, no way to tell.

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

                  1 Reply Last reply Reply Quote 0
                  • L
                    luca last edited by

                    I tried again from Qt installed with online installer:

                    ./configure .... -v
                    ...
                    ...
                    ...
                    Trying source 0 (type mysqlConfig) of library mysql ...
                    mysql_config not found.
                      => source produced no result.
                    Trying source 1 (type mysqlConfig) of library mysql ...
                    mysql_config not found.
                      => source produced no result.
                    Trying source 2 (type mysqlConfig) of library mysql ...
                    mysql_config not found.
                      => source produced no result.
                    Trying source 3 (type mysqlConfig) of library mysql ...
                    mysql_config not found.
                      => source produced no result.
                    Trying source 4 (type inline) of library mysql ...
                    mysql.h not found in [] and global paths.
                      => source produced no result.
                    Trying source 5 (type inline) of library mysql ...
                      => source failed condition 'config.win32'.
                    Trying source 6 (type inline) of library mysql ...
                      => source failed condition 'config.win32'.
                    Trying source 7 (type inline) of library mysql ...
                    mysql.h not found in [] and global paths.
                      => source produced no result.
                    Trying source 8 (type inline) of library mysql ...
                    mysql.h not found in [] and global paths.
                      => source produced no result.
                    

                    while from Qt from tar.gz source:

                    ./configure .... -v
                    ...
                    ...
                    ...
                    Trying source 0 (type mysqlConfig) of library mysql ...
                    + /usr/bin/mysql_config --version
                    > 10.3.23
                    + /usr/bin/mysql_config --libs_r
                    > -L/usr/lib/x86_64-linux-gnu/ -lmariadb
                    + /usr/bin/mysql_config --include
                    > -I/usr/include/mariadb -I/usr/include/mariadb/mysql
                    + cd /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql && /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += static warn_off console single_arch" 'QMAKE_USE += mysql' 'QMAKE_LIBS_MYSQL = -L/usr/lib/x86_64-linux-gnu/' 'QMAKE_INCDIR_MYSQL = /usr/include/mariadb /usr/include/mariadb/mysql' /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql
                    + cd /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql && MAKEFLAGS= /usr/bin/make
                    > g++ -c -pipe -O2 -w -fPIC  -I. -isystem /usr/include/mariadb -isystem /usr/include/mariadb/mysql -I/mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/qtbase/mkspecs/linux-g++ -o main.o main.cpp
                    > g++ -Wl,-O1 -o mysql main.o   -L/usr/lib/x86_64-linux-gnu/   
                    > /usr/bin/ld: main.o: in function `main':
                    > main.cpp:(.text.startup+0x5): undefined reference to `mysql_get_client_version'
                    > collect2: error: ld returned 1 exit status
                    > make: *** [Makefile:67: mysql] Error 1
                     => source failed verification.
                    Trying source 1 (type mysqlConfig) of library mysql ...
                    + /usr/bin/mysql_config --version
                    > 10.3.23
                    + /usr/bin/mysql_config --libs
                    > -L/usr/lib/x86_64-linux-gnu/ -lmariadb
                    + /usr/bin/mysql_config --include
                    > -I/usr/include/mariadb -I/usr/include/mariadb/mysql
                    + cd /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql && /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += static warn_off console single_arch" 'QMAKE_USE += mysql' 'QMAKE_LIBS_MYSQL = -L/usr/lib/x86_64-linux-gnu/' 'QMAKE_INCDIR_MYSQL = /usr/include/mariadb /usr/include/mariadb/mysql' /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql
                    + cd /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql && MAKEFLAGS= /usr/bin/make clean && MAKEFLAGS= /usr/bin/make
                    > rm -f main.o
                    > rm -f *~ core *.core
                    > g++ -c -pipe -O2 -w -fPIC  -I. -isystem /usr/include/mariadb -isystem /usr/include/mariadb/mysql -I/mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/qtbase/mkspecs/linux-g++ -o main.o main.cpp
                    > g++ -Wl,-O1 -o mysql main.o   -L/usr/lib/x86_64-linux-gnu/   
                    > /usr/bin/ld: main.o: in function `main':
                    > main.cpp:(.text.startup+0x5): undefined reference to `mysql_get_client_version'
                    > collect2: error: ld returned 1 exit status
                    > make: *** [Makefile:67: mysql] Error 1
                     => source failed verification.
                    Trying source 2 (type mysqlConfig) of library mysql ...
                    + /usr/bin/mysql_config --version
                    > 10.3.23
                    + /usr/bin/mysql_config --libs_r
                    > -L/usr/lib/x86_64-linux-gnu/ -lmariadb
                    + /usr/bin/mysql_config --include
                    > -I/usr/include/mariadb -I/usr/include/mariadb/mysql
                    + cd /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql && /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += static warn_off console single_arch" 'QMAKE_USE += mysql' 'QMAKE_LIBS_MYSQL = -L/usr/lib/x86_64-linux-gnu/ -lmariadb' 'QMAKE_INCDIR_MYSQL = /usr/include/mariadb /usr/include/mariadb/mysql' /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql
                    + cd /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql && MAKEFLAGS= /usr/bin/make clean && MAKEFLAGS= /usr/bin/make
                    > rm -f main.o
                    > rm -f *~ core *.core
                    > g++ -c -pipe -O2 -w -fPIC  -I. -isystem /usr/include/mariadb -isystem /usr/include/mariadb/mysql -I/mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/qtbase/mkspecs/linux-g++ -o main.o main.cpp
                    > g++ -Wl,-O1 -o mysql main.o   -L/usr/lib/x86_64-linux-gnu/ -lmariadb   
                     => source accepted.
                    
                    

                    It seems it's looking for different path of mysq_config .

                    eyllanesc 1 Reply Last reply Reply Quote 0
                    • eyllanesc
                      eyllanesc @luca last edited by

                      @luca install libmysqlclient-dev package

                      If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post