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. [SOLVED] Mysql driver not compile in QT 5.3 for Android
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Mysql driver not compile in QT 5.3 for Android

Scheduled Pinned Locked Moved Mobile and Embedded
19 Posts 5 Posters 8.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.
  • P Offline
    P Offline
    projetoslinux
    wrote on last edited by
    #1

    Hi
    I have crosscompiled mysql for android with sucess in qt 5.2.1 but with 5.3.0-RC
    have a error in mysql.h

    use RazZziel script

    qt

    #pkg=qt-everywhere-opensource-src-5.2.1.tar.gz
    pkg=qtbase-opensource-src-5.3.0.tar.gz
    #dir=$(basename $pkg .tar.gz)
    dir=$"/home/fuinha/QTfinal/5.3.0/Src/qtbase"

    #if [ ! -d $dir ]; then
    #[ -f $pkg ] || wget http://download.qt-project.org/official_releases/qt/5.2/5.2.1/single/$pkg

    [ -f $pkg ] || wget http://download.qt-project.org/official_releases/qt/5.3/5.3.0/submodules/$pkg

    tar -xf $pkg || exit 1

    #fi

    pushd $dir/src/plugins/sqldrivers/mysql/
    #qmake=~/"Applications/Qt/5.2.1/gcc/bin/qmake"
    #qmake=~/"QTfinal/AUTO/5.2.1/android_armv7/bin/qmake"
    qmake=~/"QTfinal/5.3.0/android_armv7/bin/qmake"

    $qmake "INCLUDEPATH+=$SR/usr/include/" "LIBS+=$SR/usr/lib/mariadb/libmariadbclient.a $SR/usr/lib/libssl.a $SR/usr/lib/libcrypto.a $SR/usr/lib/libiconv.a" "LIBPATH+=$SR/usr/lib/" -o Makefile mysql.pro
    make || exit 1
    make install || exit 1
    popd

    and have this error
    /home/fuinha/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-g++ -c -Wno-psabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -DANDROID -Wa,--noexecstack -std=gnu++0x -g -g -gdwarf-2 -marm -O0 -fno-omit-frame-pointer -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -Wno-psabi -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I../../../../mkspecs/android-g++ -I. -I/home/fuinha/android-ndk/platforms/android-19/arch-arm/usr/include -I../../../../include/QtSql/5.3.0 -I../../../../include/QtSql/5.3.0/QtSql -I../../../../include -I../../../../include/QtSql -I../../../../include/QtCore/5.3.0 -I../../../../include/QtCore/5.3.0/QtCore -I../../../../include/QtCore -I.moc -I/home/fuinha/android-ndk/sources/cxx-stl/gnu-libstdc++/4.8/include -I/home/fuinha/android-ndk/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include -isystem /home/fuinha/android-ndk/platforms/android-9/arch-arm/usr/include -o .obj/main.o main.cpp
    In file included from main.cpp:44:0:
    ../../../sql/drivers/mysql/qsql_mysql_p.h:63:19: fatal error: mysql.h: No such file or directory
    #include <mysql.h>
    ^
    compilation terminated.
    make: *** [.obj/main.o] Error 1

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dirk_sy
      wrote on last edited by
      #2

      @projetoslinux: I developed a program on QT for android on win7 but not on linux, could you share your libmysql.so ? i want to try it on my win7 develop platforms,thanks.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jiangcaiyang
        wrote on last edited by
        #3

        I guess most developers favors SQLite on Android.

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

          Hi,

          It's not a question of favorite database. Android doesn't have an official MySQL native library.

          projetoslinux double check that the path you are giving for the includes are correct

          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
          0
          • P Offline
            P Offline
            projetoslinux
            wrote on last edited by
            #5

            Ok

            Im testing
            thanks SGaist !!!

            dirk_sy if you want a lib for linux armv7a send-me a mail and i replay whit is
            my mail

            thanks

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

              You should avoid posting your email address like that, it's not protected. You can send it directly to dirk_sy through the contact member page.

              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
              0
              • P Offline
                P Offline
                projetoslinux
                wrote on last edited by
                #7

                Sorry and Thanks Sgaist !!!

                mail edited ...

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  dirk_sy
                  wrote on last edited by
                  #8

                  the contact member page cannot write in an email address,how can we contact each other?by the way ,how can I compile a Mysql driver at win7-32?is there any way I can follow?please ,help,thanks.
                  @projetoslinux: I have send a message to u,and I have write an address in the message,my user name ,you can find here.thanks again.

                  1 Reply Last reply
                  0
                  • P Offline
                    P Offline
                    projetoslinux
                    wrote on last edited by
                    #9

                    After several weeks I found PROBLEM

                    Only add line to ad include and libs in qmake

                    "INCLUDEPATH+=$SR/usr/include/mariadb/" "LIBPATH+=$SR/usr/lib/mariadb/"

                    thanks !!!

                    1 Reply Last reply
                    0
                    • D Offline
                      D Offline
                      dmitriiv84
                      wrote on last edited by
                      #10

                      Hi, I'm trying unsuccessfully for a week to collect mysql driver for android, can I throw libmysql.so, will be very grateful. Or where there is a link to instructions on how to assemble.

                      1 Reply Last reply
                      0
                      • P Offline
                        P Offline
                        projetoslinux
                        wrote on last edited by
                        #11

                        link to download mysql plugins for armv7
                        http://www.adrive.com/public/vUYRMb/libqsqlmysql.so
                        compiled in ubuntu 14.04 32bits

                        1 Reply Last reply
                        0
                        • D Offline
                          D Offline
                          dmitriiv84
                          wrote on last edited by
                          #12

                          Thank you very much. but after much agonizing gathered under Ubuntu 14.04 amd64.
                          And who knows how to build under windows?

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

                            For Windows, please search the forum, it has been asked and answered many times already

                            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
                            0
                            • D Offline
                              D Offline
                              dmitriiv84
                              wrote on last edited by
                              #14

                              Please tell me exactly where I can not find this discussion, and I see Mr. forum only questions and no concrete answers.

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

                                Did you first follow the guide from the documentation ? What error did you have ?

                                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
                                0
                                • D Offline
                                  D Offline
                                  dmitriiv84
                                  wrote on last edited by
                                  #16

                                  In general, I can not find the assembly instructions for Android MySQL under Windows. And under Ubuntu 14.04 but I gathered when compiling the project, it gives the driver is available but not loaded. Under Ubuntu, collected according to the instructions https://qt-project.org/wiki/Build_Qt5_mysql_plugin_for_Android

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

                                    You won't find them because officially, there's no MySQL client library for Android.

                                    The guides provide instructions for MariaDB so you have that option, but if you want to save time, just follow the guide, then copy the needed resulting files to your Windows installation.

                                    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
                                    0
                                    • D Offline
                                      D Offline
                                      dmitriiv84
                                      wrote on last edited by
                                      #18

                                      Thanks for the replies I will try. I would like to specify which files you want to copy -libqsqlmysql.so and libmariadb.so? Or need some other files?

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

                                        It's all shown in the wiki entry you mentioned earlier

                                        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
                                        0

                                        • Login

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