Qt 5.13.0 - Build postgres driver for android
-
Hello, i would like to build the postgres driver for android. Does anyone knows the way that i can do that? When i was used qt 5.9.6 i have followed the following instructions: https://wiki.qt.io/Build_Qt_5_PostgreSQL_Plugin_for_Android
This instructions not work in Qt 5.13.0. Any suggestions?
-
When i am doing the steps of the https://wiki.qt.io/Build_Qt_5_PostgreSQL_Plugin_for_Android i am getting the following error:
Project ERROR: Library 'psql' is not defined. -
Hi,
The build instructions have changed. See the Qt documentation for that and adapt the guide to them.
-
WIth this instructions i am getting the following error:
android-ndk-r19c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: /usr/lib/x86_64-linux-gnu/libpq.so: incompatible target
Any idea?
-
@NickV said in Qt 5.13.0 - Build postgres driver for android:
/usr/lib/x86_64-linux-gnu/libpq.so
This lib was built for x86_64, not ARM. You need this lib in your sysroot for ARM.
-
It's explained in the Wiki page you are using as reference.
-
@jsulm
export ANDROID_NDK_ROOT="/<path-to-ndk>/android-ndk-r15c"
SR="$ANDROID_NDK_ROOT/platforms/android-21/arch-arm"
BR="$ANDROID_NDK_ROOT/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-"and then cd to postgres folder
STRIP="$BR"strip RANLIB="$BR"ranlib OBJDUMP="$BR"objdump AR="$BR"ar CC="$BR"gcc CFLAGS=--sysroot=$SR CPP="$BR"cpp CPPFLAGS=$CFLAGS ./configure --prefix=$SR/usr --host=arm-linux-androideabi --target=arm-linux-androideabi --build="$CHOST" --without-readline --with-openssl --with-includes=/<path-to-openssl>/openssl-1.0.2n/include --with-libs=/<path-to-openssl>/openssl-1.0.2nsed -e 's/lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)/lib$(NAME)$(DLSUFFIX)/g' -i src/Makefile.shlib
sed -e 's/lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)/lib$(NAME)$(DLSUFFIX)/g' -i src/Makefile.shlibmake -C src/interfaces/libpq
WIth this instructions i made it to create a libpq.so form arm architecture but it is for 32bit not for 64bit. If i use android ndk r18b then the libpq.so that produced is for x86_64 architecture.
-
Since you are building for 5.13 you should change to NDK r19 at least.
-
It should be since it's available on Debian for arm64. However there might be a flag to set somewhere.
-
@Nogood said in Qt 5.13.0 - Build postgres driver for android:
Hi, has anyone managed to put together a psql android plugin for qt qml app? My application is not connecting to postgres database on another machine.
Hi and welcome to devnet,
Did you follow the guide @NickV used ?
If not, what did you do ?
If you did, what error message do you get ?
Also, are you sure you can access that database remotely from another computer ?
Did you start your application with the QT_DEBUG_PLUGINS environment variable set to 1 in order to have more information ?