Results 1 to 5 of 5

Thread: mysql plugin on android, requires libmysqlclient_r.so built with android toolchain

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2013
    Posts
    17
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default mysql plugin on android, requires libmysqlclient_r.so built with android toolchain

    So now im at it again...

    trying to compile mysql-connector-c-6.1.1-src, but its a cmake file, and if i open it in qt creator, even thou i have selected arm-android toolchain, it uses the gcc from /usr/bin/gcc, so its successful, but i dont want a unix lib, i want a android lib...


    so question is, can i somehow make a .pro file, that i can use to crosscompile this lib?

    im pretty sure its possible to port this c code to android without any big modifications, but i dont really know where to start, it seems most i find on google, is about making a toolchain for cmake, so it crosscompiles, i've tryed that, but it just says that the compiler cant make a working testcompile, so the cmake process gets stuffed in the trashbin..


    http://www.mymegabyte.com/2011/03/cr...pile-libmysql/

    code below is what happens with the toolchain abowe, just switched out the compilers to android-gcc and android-g++ that i symlinked from the ndk r9 toolchains..

    Qt Code:
    1. stingray@stingray-server:~/src/mysql-connector-c-6.1.1-src/build$ cmake -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX=`pwd`/install -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake ..
    2. -- Running cmake version 2.8.10.1
    3. -- The C compiler identification is unknown
    4. -- The CXX compiler identification is unknown
    5. -- Check for working C compiler: /home/stingray/Qt/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc
    6. -- Check for working C compiler: /home/stingray/Qt/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc -- broken
    7. CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
    8. The C compiler
    9. "/home/stingray/Qt/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc"
    10. is not able to compile a simple test program.
    11.  
    12. It fails with the following output:
    13.  
    14. Change Dir: /home/stingray/src/mysql-connector-c-6.1.1-src/build/CMakeFiles/CMakeTmp
    15.  
    16.  
    17.  
    18. Run Build Command:/usr/bin/make "cmTryCompileExec2945069581/fast"
    19.  
    20. /usr/bin/make -f CMakeFiles/cmTryCompileExec2945069581.dir/build.make
    21. CMakeFiles/cmTryCompileExec2945069581.dir/build
    22.  
    23. make[1]: GÃ¥r till katalogen
    24. "/home/stingray/src/mysql-connector-c-6.1.1-src/build/CMakeFiles/CMakeTmp"
    25.  
    26. /usr/bin/cmake -E cmake_progress_report
    27. /home/stingray/src/mysql-connector-c-6.1.1-src/build/CMakeFiles/CMakeTmp/CMakeFiles
    28. 1
    29.  
    30. Building C object
    31. CMakeFiles/cmTryCompileExec2945069581.dir/testCCompiler.c.o
    32.  
    33.  
    34. /home/stingray/Qt/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc
    35. GNU -o CMakeFiles/cmTryCompileExec2945069581.dir/testCCompiler.c.o -c
    36. /home/stingray/src/mysql-connector-c-6.1.1-src/build/CMakeFiles/CMakeTmp/testCCompiler.c
    37.  
    38.  
    39. arm-linux-androideabi-gcc: error: GNU: No such file or directory
    40.  
    41. make[1]: *** [CMakeFiles/cmTryCompileExec2945069581.dir/testCCompiler.c.o]
    42. Fel 1
    43.  
    44. make[1]: Lämnar katalogen
    45. "/home/stingray/src/mysql-connector-c-6.1.1-src/build/CMakeFiles/CMakeTmp"
    46.  
    47. make: *** [cmTryCompileExec2945069581/fast] Fel 2
    48.  
    49.  
    50.  
    51.  
    52.  
    53. CMake will not be able to correctly generate this project.
    54. Call Stack (most recent call first):
    55. CMakeLists.txt:99 (PROJECT)
    56.  
    57.  
    58. -- Configuring incomplete, errors occurred!
    To copy to clipboard, switch view to plain text mode 

    this is also a intresting site http://code.google.com/p/android-cmake/

    but its not much on how to use it, or im just plain stupid, cause i cant get it to work..

    anyway i guess theres alot of people that have been bitching with this, and since they ported OpenCV, then it has to be possible, but question is how..

  2. #2
    Join Date
    Aug 2013
    Posts
    17
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: mysql plugin on android, requires libmysqlclient_r.so built with android toolchai

    so i guess theres alot of people that accually are intrested in this.. i've bashed my head on this for a while now, and it seems its possible..

    https://github.com/0x-ff/libmysql-android

    there is a guy who ported libmysql with apis android-8,9,14, and i used his prebuilt api 14 and the sources sqldriver/mysql/mysql.pro and hardcoded in the place where i put the libs just to make sure it found them.. the best part with using sources pro, it put it where it should be in my android-qt-5.1.0 subcat so not even that was needed..

    now its test time

  3. #3
    Join Date
    Aug 2013
    Posts
    17
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: mysql plugin on android, requires libmysqlclient_r.so built with android toolchai

    just a little edit to my monolouge.. it puts the qsqlmysql.so in the right path, just that it creates that path inside android, under the pro files folder, so it was almost right..

    but the libqsqlmysql created works good on a htc flyer with android 3.2. seems to error on the emulator @ android 3.2, but it was late last night so will have a look and update for future reference..

  4. #4
    Join Date
    Mar 2010
    Posts
    77
    Thanks
    17
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: mysql plugin on android, requires libmysqlclient_r.so built with android toolchai

    Hey man!
    Sounds exciting!

    Did you make any more progress on this? Were you able to get it to function stable/fully?
    I would sure love to have fully functioning MySQL-support on Android for a project of mine...
    /Tottish

  5. #5
    Join Date
    Aug 2013
    Posts
    17
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: mysql plugin on android, requires libmysqlclient_r.so built with android toolchai

    i've taken up this little project again..

    used https://github.com/0x-ff/libmysql-android to build the plugin for android_armv7..

    wasnt able to use qtcreator to build the mysql.pro

    so had to do it in terminal..

    Qt Code:
    1. stingray@laptop:~/Qt/5.3/Src/qtbase/src/plugins/sqldrivers/mysql$ ~/Qt/5.3/android_armv7/bin/qmake "INCLUDEPATH+=/usr/include/mysql" "LIBS+=-L/home/stingray/Qt/Projekt/libs/android/android14-arm -lmysqlclient_r" mysql.pro
    2. stingray@laptop:~/Qt/5.3/Src/qtbase/src/plugins/sqldrivers/mysql$ make
    To copy to clipboard, switch view to plain text mode 

    the only thing is the LIBS path have to point to where you have dl'ed the android14-arm and unpacked them..

    anyway it seems to work as it should on my android 3.2 htc flyer.. have not tested on emulator..

    as right now i have to rebuild my gui after a little misshap during december when i thought i had backed up my project folder, but it was a old version.. but hey, one step forward three backwards.. one day it might accually be finnished.. hehe..

Similar Threads

  1. How to deploy qt5 qml plugin to android?
    By Thomas1313 in forum Installation and Deployment
    Replies: 0
    Last Post: 19th August 2013, 10:24
  2. How do you make android applications display correctly on android phone?
    By Cyrebo in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 17th August 2013, 08:31
  3. is android app with qt 5.1 just compatible with android 4 ?
    By solook in forum Qt for Embedded and Mobile
    Replies: 5
    Last Post: 14th August 2013, 17:23
  4. Android
    By Viper666 in forum Qt Programming
    Replies: 9
    Last Post: 3rd January 2013, 13:45
  5. MYSQL plugin seems to be built properly, but not loaded in QtCreator [Windows]
    By GabrielGray in forum Installation and Deployment
    Replies: 1
    Last Post: 29th June 2010, 20:38

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.