Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt configure could not find MySQL installation when cross compiling for raspi3?
Forum Updated to NodeBB v4.3 + New Features

Qt configure could not find MySQL installation when cross compiling for raspi3?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
mysqlqmysqlqt5cross compileraspberry pi 3
6 Posts 2 Posters 1.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • IMAN4KI Offline
    IMAN4KI Offline
    IMAN4K
    wrote on last edited by IMAN4K
    #1

    Hi everyone.
    Right to the point, here is my configure command I used:

    ../configure -release -opengl es2 -no-eglfs -qt-xcb -xcb -sql-mysql -no-use-gold-linker -opensource -confirm-license -nomake examples -nomake tests -make libs -device linux-rasp-pi3-g++ -device-option CROSS_COMPILE=$RPI_TOOLCHAIN -sysroot $RPI_SYSROOT -prefix /usr/local/qt5pi -hostprefix ~/toolchain/qt5 -extprefix ~/toolchain/qt5pi -recheck-all
    

    And here is the mysql confirmation on pi(i haved synced the sysroot to my host machine):

    pi@raspberrypi:~ $ mysql_config --version
    10.1.38
    pi@raspberrypi:~ $ mysql_config --libs
    -L/usr/lib/arm-linux-gnueabihf  -lmariadbclient -lpthread -lz -lm -ldl
    pi@raspberrypi:~ $ mysql_config --include
    -I/usr/include/mysql
    

    But the configure command throw nasty error:

    ERROR: Feature 'sql-mysql' was enabled, but the pre-condition 'libs.mysql' failed.
    

    config.log for more details:

    [...]
    looking for library mysql
    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 ...
    mysql.h not found in [] and global paths.
      => source produced no result.
    test config.qtbase_sqldrivers.libraries.mysql FAILED
    [...]
    

    It seems that configure looks for mysql_config in host machine! what should we do?

    1 Reply Last reply
    0
    • DewyD Offline
      DewyD Offline
      Dewy
      wrote on last edited by
      #2

      You should change '-plugin-sql-mysql' parameter. Remove that and add '-qt-sql-mysql'

      As you can see https://doc.qt.io/archives/qt-4.8/configure-options.html for details.

      IMAN4KI 1 Reply Last reply
      0
      • DewyD Dewy

        You should change '-plugin-sql-mysql' parameter. Remove that and add '-qt-sql-mysql'

        As you can see https://doc.qt.io/archives/qt-4.8/configure-options.html for details.

        IMAN4KI Offline
        IMAN4KI Offline
        IMAN4K
        wrote on last edited by
        #3

        Hi @dewy

        That's for Qt4, for new versions (5.12.3 for mine) as the ./configure --help says:

        [...]
        Database options:
        
          -sql-<driver> ........ Enable SQL <driver> plugin. Supported drivers:
                                 db2 ibase mysql oci odbc psql sqlite2 sqlite tds
                                 [all auto]
          -sqlite .............. Select used sqlite3 [system/qt]
        [...]
        

        We should use -sql-mysql to enable plugin.

        1 Reply Last reply
        0
        • DewyD Offline
          DewyD Offline
          Dewy
          wrote on last edited by
          #4

          Hello again,
          That's mean, you cannot use plugin type for configure. when I used plugin types, have bugs. So I use that.
          For 5.x.x versions, '-sql-mysql'

          1 Reply Last reply
          0
          • IMAN4KI Offline
            IMAN4KI Offline
            IMAN4K
            wrote on last edited by IMAN4K
            #5
            This post is deleted!
            1 Reply Last reply
            0
            • IMAN4KI Offline
              IMAN4KI Offline
              IMAN4K
              wrote on last edited by IMAN4K
              #6

              Seems to be a bug reported here QTBUG-50244

              Nobody tried to integrate MySQL for a Raspberry Pi project already ?! no workaround?!
              Seems strange :(

              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