[SOLVED]Cannot compile Qt 5.2 from Git for Android including mysql support
-
... and here's how you get iconv to compile: Grab the sources, and in the source dir, do the following:
@STRIP="$BR"strip RANLIB="$BR"ranlib OBJDUMP="$BR"objdump AR="$BR"ar CC="$BR"gcc CFLAGS=--sysroot=$SR CPP="$BR"cpp CPPFLAGS=$CFLAGS ./configure --build=x86_64 --host=arm --prefix=$SR/usr --with-sysroot=$SR && make install@
-
Hi and welcome to devnet,
Thanks for sharing your solution. You could create a wiki page with the complete solution. It might be easier for other forum users to find it.
In between, please update the thread title to solved, so other forum user may know a solution has been found :)
-
You're probably right. I wrote up a wiki "here":http://qt-project.org/wiki/Build_Qt5_mysql_plugin_for_Android
-
Hi for all
this wiki is great
I have sucess but only in 2 last commands , i have error
its possible help-memy ubuntu is 12.04
my dir is /home/fuinha/Qt5.2.0/5.2.0/my error in
"$BR"objdump -p libqsqlmysql.so | grep NEEDED
-->> 'libqsqlmysql.so': No such file
why NEEDED
im my /Qt5.2.0/5.2.0/Src/qtbase/src/plugins/sqldrivers/mysql$
../../../../bin/qmake "INCLUDEPATH+=$SR/usr/include/mariadb" "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/mariadb" -o Makefile mysql.pro && make install
-->>bash: ../../../../bin/qmake: No such file or directory
i work in
/home/fuinha/Qt5.2.0/5.2.0/gcc_64/bin/qmake "INCLUDEPATH+=$SR/usr/include/mariadb" "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/mariadb" -o Makefile mysql.pro && make install-->> .../gcc_64/include/QtCore -I.moc main.cpp -o .moc/main.moc
moc: Cannot create .moc/main.moc
make: *** [.moc/main.moc] Error 1and
/home/fuinha/Qt5.2.0/5.2.0/android_armv7/bin/qmake "INCLUDEPATH+=$SR/usr/include/mariadb" "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/mariadb" -o Makefile mysql.pro && make install---->>>
Project ERROR: You need to set the ANDROID_NDK_ROOT environment variable to point to your Android NDK.
Could not read qmake configuration file /home/fuinha/Qt5.2.0/5.2.0/Src/qtbase/mkspecs/android-g++/qmake.conf.
Error processing project file: mysql.proSorry for my newbie questions and thanks for help-me
-
The first error you posted:
../../../../bin/qmake “INCLUDEPATH+=$SR/usr/include/mariadb” “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/mariadb” -o Makefile mysql.pro && make install
—>>bash: ../../../../bin/qmake: No such file or directory
Implies that you did not build qt before executing those commands. You must first build qt 5.2.0 (as you have selected) with whatever options you want, minus the mysql database options. This will in turn produce the "qmake" executable that the error shows was never generated. This specific executable has all the correct parameters configured for android, which is why you need to use it rather than whatever version of Qt may be installed with your system.
-
I also just noticed this section of your post:
“$BR“objdump -p libqsqlmysql.so | grep NEEDED
—>> ‘libqsqlmysql.so’: No such file
why NEEDED
Checking the wiki, it appears someone added a bit after my initial posting (one of the nice things about wikis :)). Whoever added that, what they're saying is that you need to add a list of dependencies to the APK image, and grepping for "NEEDED" will tell you what the dependencies for the plugin are (which should be the dependencies I listed at the top, but this is a good thing to check). You also need to do this after successfully building the plugin (which is why it couldn't find it), so given your problem with building the plugin, you shouldn't be running this yet.
-
thanks i testing
-
tHANK YOU SOLVED FOR ME !!!!
-
Hi all,
I follow above steps to compiler, at the final step, i got the error message, pls help me, tks!
pos@pos-MS-7817:~/adt/qt5/qtbase/src/plugins/sqldrivers/mysql$ SR=~/adt/android-ndk-r10d/platforms/android-9/arch-arm
pos@pos-MS-7817:~/adt/qt5/qtbase/src/plugins/sqldrivers/mysql$ BR=~/adt/android-ndk-r10d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-
pos@pos-MS-7817:~/adt/qt5/qtbase/src/plugins/sqldrivers/mysql$ ../../../../bin/qmake "INCLUDEPATH+=$SR/usr/include/mariadb" "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/mariadb" -o Makefile mysql.pro && make install
rm -f libqsqlmysql.so
g++ -Wl,--no-undefined -Wl,-O1 -fuse-ld=gold -Wl,-rpath,/usr/local/Qt-5.4.0/lib -shared -o libqsqlmysql.so .obj/main.o .obj/qsql_mysql.o .obj/moc_qsql_mysql_p.o -L/home/pos/adt/android-ndk-r10d/platforms/android-9/arch-arm/usr/lib/mariadb /home/pos/adt/android-ndk-r10d/platforms/android-9/arch-arm/usr/lib/mariadb/libmariadbclient.a /home/pos/adt/android-ndk-r10d/platforms/android-9/arch-arm/usr/lib/libssl.a /home/pos/adt/android-ndk-r10d/platforms/android-9/arch-arm/usr/lib/libcrypto.a /home/pos/adt/android-ndk-r10d/platforms/android-9/arch-arm/usr/lib/libiconv.a -lmysqlclient -L/home/pos/adt/qt5/qtbase/lib -lQt5Sql -lQt5Core -lpthread
/usr/bin/ld.gold: fatal error: /home/pos/adt/android-ndk-r10d/platforms/android-9/arch-arm/usr/lib/mariadb/libmariadbclient.a(libmariadb.c.o): unsupported ELF machine number 40
collect2: error: ld returned 1 exit status
make: *** [../../../../plugins/sqldrivers/libqsqlmysql.so] Error 1
pos@pos-MS-7817:~/adt/qt5/qtbase/src/plugins/sqldrivers/mysql$ -
Hi all,
I follow above steps to compiler, at the final step, i got the error message, pls help me, tks!
pos@pos-MS-7817:~/adt/qt5/qtbase/src/plugins/sqldrivers/mysql$ SR=~/adt/android-ndk-r10d/platforms/android-9/arch-arm
pos@pos-MS-7817:~/adt/qt5/qtbase/src/plugins/sqldrivers/mysql$ BR=~/adt/android-ndk-r10d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-
pos@pos-MS-7817:~/adt/qt5/qtbase/src/plugins/sqldrivers/mysql$ ../../../../bin/qmake "INCLUDEPATH+=$SR/usr/include/mariadb" "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/mariadb" -o Makefile mysql.pro && make install
rm -f libqsqlmysql.so
g++ -Wl,--no-undefined -Wl,-O1 -fuse-ld=gold -Wl,-rpath,/usr/local/Qt-5.4.0/lib -shared -o libqsqlmysql.so .obj/main.o .obj/qsql_mysql.o .obj/moc_qsql_mysql_p.o -L/home/pos/adt/android-ndk-r10d/platforms/android-9/arch-arm/usr/lib/mariadb /home/pos/adt/android-ndk-r10d/platforms/android-9/arch-arm/usr/lib/mariadb/libmariadbclient.a /home/pos/adt/android-ndk-r10d/platforms/android-9/arch-arm/usr/lib/libssl.a /home/pos/adt/android-ndk-r10d/platforms/android-9/arch-arm/usr/lib/libcrypto.a /home/pos/adt/android-ndk-r10d/platforms/android-9/arch-arm/usr/lib/libiconv.a -lmysqlclient -L/home/pos/adt/qt5/qtbase/lib -lQt5Sql -lQt5Core -lpthread
/usr/bin/ld.gold: fatal error: /home/pos/adt/android-ndk-r10d/platforms/android-9/arch-arm/usr/lib/mariadb/libmariadbclient.a(libmariadb.c.o): unsupported ELF machine number 40
collect2: error: ld returned 1 exit status
make: *** [../../../../plugins/sqldrivers/libqsqlmysql.so] Error 1
pos@pos-MS-7817:~/adt/qt5/qtbase/src/plugins/sqldrivers/mysql$