Build Postgresl for Android Qt 5.15.10
-
wrote on 16 Dec 2023, 20:25 last edited by piervalli
Hello,
I have a virtual machine with Ubuntu 20.04, I have built 5.15.10 with successfully Qt. Apk it is generated correctly. Now I should add Postgresql I have downloaded binary file for Arm from termux
That is configure with flags:
/home/pier/data/build/qt-everywhere-src-5.15.10/qtbase/configure -top-level -xplatform android-clang -verbose -recheck-all -shared -prefix /home/pier/data/build/5.15.10/android_arm64-v8a -opensource -confirm-license -c++std c++17 -opengl es2 -disable-rpath -nomake tests -nomake examples -android-ndk /home/pier/Android/Sdk/ndk/22.1.7171670 -android-sdk /home/pier/Android/Sdk -android-abis arm64-v8a -no-warnings-are-errors IBASE_PREFIX=/home/pier/data/build/Firebird-5.0.0-linux-arm64/buildroot/opt/firebird IBASE_INCDIR=/home/pier/data/build/Firebird-5.0.0-linux-arm64/buildroot/opt/firebird/include IBASE_LIBS=-lfbclient PSQL_INCDIR=/home/pier/data/build/postgresql_16.1_aarch64/usr/include PSQL_PREFIX=/home/pier/data/build/postgresql_16.1_aarch64/usr PSQL_LIBS=-lpq
The error is libpq-fe.h not found
Trying source 1 (type psqlConfig) of library psql ... pg_config not found. => source produced no result. Trying source 2 (type psqlEnv) of library psql ... => source failed condition 'config.win32'. Trying source 3 (type psqlEnv) of library psql ... Include path /home/pier/data/build/postgresql_16.1_aarch64/usr/include is invalid. Include path /home/pier/data/build/postgresql_16.1_aarch64/usr/include is invalid. libpq-fe.h not found in [/home/pier/data/build/postgresql_16.1_aarch64/usr/include /home/pier/data/build/postgresql_16.1_aarch64/usr/include] and global paths.
Qt Sql Drivers: DB2 (IBM) .............................. no InterBase .............................. yes MySql .................................. no OCI (Oracle) ........................... no ODBC ................................... no PostgreSQL ............................. no SQLite2 ................................ no SQLite ................................. yes
Thanks
-
Hi,
Where is that file located in your PostgreSQL Androïd build ?
-
wrote on 17 Dec 2023, 22:56 last edited by piervalli
@SGaist
I thanks i have corrected the path now it is founded.
Now I need to found and link two missing libs libpgcommon and libpgport
Dev of Postgres indicated that are required for build the driver.rror: undefined symbol: pg_encoding_mblen > >>> referenced by fe-exec.o:(PQescapeStringInternal) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-exec.o:(PQescapeInternal) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-exec.o:(PQescapeInternal) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced 2 more times > ld: error: undefined symbol: pg_vsnprintf > >>> referenced by fe-exec.o:(pqInternalNotice) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by pqexpbuffer.o:(printfPQExpBuffer) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by pqexpbuffer.o:(appendPQExpBuffer) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > ld: error: undefined symbol: pg_sprintf > >>> referenced by fe-exec.o:(pqInternalNotice) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-connect.o:(PQsetClientEncoding) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > ld: error: undefined symbol: pg_char_to_encoding > >>> referenced by fe-exec.o:(pqSaveParameterStatus) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-misc.o:(PQenv2encoding) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > ld: error: undefined symbol: __isoc99_sscanf > >>> referenced by fe-exec.o:(pqSaveParameterStatus) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > ld: error: undefined symbol: pg_tolower > >>> referenced by fe-exec.o:(PQfnumber) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-exec.o:(PQfnumber) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > ld: error: undefined symbol: __ctype_b_loc > >>> referenced by fe-exec.o:(PQcmdTuples) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-connect.o:(parse_int_param) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-connect.o:(parseServiceFile) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced 4 more times > ld: error: undefined symbol: pg_encoding_dsplen > >>> referenced by fe-misc.o:(PQdsplen) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-protocol3.o:(pqBuildErrorMessage3) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-protocol3.o:(pqBuildErrorMessage3) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > ld: error: undefined symbol: dcgettext > >>> referenced by fe-misc.o:(libpq_gettext) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-misc.o:(libpq_gettext) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > ld: error: undefined symbol: __errno_location > >>> referenced by fe-misc.o:(libpq_gettext) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-misc.o:(pqSocketCheck) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-misc.o:(pqReadData) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced 44 more times > ld: error: undefined symbol: bindtextdomain > >>> referenced by fe-misc.o:(libpq_gettext) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-misc.o:(libpq_ngettext) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > ld: error: undefined symbol: pg_strerror_r > >>> referenced by fe-misc.o:(pqSocketCheck) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-connect.o:(connectFailureMessage) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-connect.o:(PQconnectPoll) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced 16 more times > ld: error: undefined symbol: dcngettext > >>> referenced by fe-misc.o:(libpq_ngettext) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > ld: error: undefined symbol: stderr > >>> referenced by fe-connect.o:(defaultNoticeProcessor) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-connect.o:(defaultNoticeProcessor) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-connect.o:(connectOptions2) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced 5 more times > ld: error: undefined symbol: pg_fprintf > >>> referenced by fe-connect.o:(defaultNoticeProcessor) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-connect.o:(connectOptions2) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-trace.o:(pqTraceOutputByte1) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced 107 more times > ld: error: undefined symbol: __explicit_bzero_chk > >>> referenced by fe-connect.o:(freePGconn) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-connect.o:(freePGconn) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-connect.o:(freePGconn) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced 2 more times > ld: error: undefined symbol: pg_strcasecmp > >>> referenced by fe-connect.o:(sslVerifyProtocolVersion) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-connect.o:(sslVerifyProtocolVersion) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-connect.o:(sslVerifyProtocolVersion) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced 14 more times > ld: error: undefined symbol: pg_strncasecmp > >>> referenced by fe-connect.o:(parseServiceFile) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > ld: error: undefined symbol: ldap_init > >>> referenced by fe-connect.o:(parseServiceFile) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > ld: error: undefined symbol: ldap_set_option > >>> referenced by fe-connect.o:(parseServiceFile) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-connect.o:(parseServiceFile) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a
-
@SGaist
I thanks i have corrected the path now it is founded.
Now I need to found and link two missing libs libpgcommon and libpgport
Dev of Postgres indicated that are required for build the driver.rror: undefined symbol: pg_encoding_mblen > >>> referenced by fe-exec.o:(PQescapeStringInternal) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-exec.o:(PQescapeInternal) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-exec.o:(PQescapeInternal) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced 2 more times > ld: error: undefined symbol: pg_vsnprintf > >>> referenced by fe-exec.o:(pqInternalNotice) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by pqexpbuffer.o:(printfPQExpBuffer) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by pqexpbuffer.o:(appendPQExpBuffer) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > ld: error: undefined symbol: pg_sprintf > >>> referenced by fe-exec.o:(pqInternalNotice) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-connect.o:(PQsetClientEncoding) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > ld: error: undefined symbol: pg_char_to_encoding > >>> referenced by fe-exec.o:(pqSaveParameterStatus) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-misc.o:(PQenv2encoding) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > ld: error: undefined symbol: __isoc99_sscanf > >>> referenced by fe-exec.o:(pqSaveParameterStatus) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > ld: error: undefined symbol: pg_tolower > >>> referenced by fe-exec.o:(PQfnumber) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-exec.o:(PQfnumber) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > ld: error: undefined symbol: __ctype_b_loc > >>> referenced by fe-exec.o:(PQcmdTuples) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-connect.o:(parse_int_param) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-connect.o:(parseServiceFile) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced 4 more times > ld: error: undefined symbol: pg_encoding_dsplen > >>> referenced by fe-misc.o:(PQdsplen) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-protocol3.o:(pqBuildErrorMessage3) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-protocol3.o:(pqBuildErrorMessage3) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > ld: error: undefined symbol: dcgettext > >>> referenced by fe-misc.o:(libpq_gettext) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-misc.o:(libpq_gettext) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > ld: error: undefined symbol: __errno_location > >>> referenced by fe-misc.o:(libpq_gettext) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-misc.o:(pqSocketCheck) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-misc.o:(pqReadData) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced 44 more times > ld: error: undefined symbol: bindtextdomain > >>> referenced by fe-misc.o:(libpq_gettext) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-misc.o:(libpq_ngettext) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > ld: error: undefined symbol: pg_strerror_r > >>> referenced by fe-misc.o:(pqSocketCheck) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-connect.o:(connectFailureMessage) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-connect.o:(PQconnectPoll) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced 16 more times > ld: error: undefined symbol: dcngettext > >>> referenced by fe-misc.o:(libpq_ngettext) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > ld: error: undefined symbol: stderr > >>> referenced by fe-connect.o:(defaultNoticeProcessor) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-connect.o:(defaultNoticeProcessor) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-connect.o:(connectOptions2) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced 5 more times > ld: error: undefined symbol: pg_fprintf > >>> referenced by fe-connect.o:(defaultNoticeProcessor) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-connect.o:(connectOptions2) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-trace.o:(pqTraceOutputByte1) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced 107 more times > ld: error: undefined symbol: __explicit_bzero_chk > >>> referenced by fe-connect.o:(freePGconn) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-connect.o:(freePGconn) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-connect.o:(freePGconn) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced 2 more times > ld: error: undefined symbol: pg_strcasecmp > >>> referenced by fe-connect.o:(sslVerifyProtocolVersion) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-connect.o:(sslVerifyProtocolVersion) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-connect.o:(sslVerifyProtocolVersion) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced 14 more times > ld: error: undefined symbol: pg_strncasecmp > >>> referenced by fe-connect.o:(parseServiceFile) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > ld: error: undefined symbol: ldap_init > >>> referenced by fe-connect.o:(parseServiceFile) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > ld: error: undefined symbol: ldap_set_option > >>> referenced by fe-connect.o:(parseServiceFile) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a > >>> referenced by fe-connect.o:(parseServiceFile) in archive /home/pier/data/build/libpq-dev_15.5-0+deb12u1_arm64/data/usr/lib/libpq.a
@piervalli did you add these two libraries to the list of what to use ?
-
@piervalli did you add these two libraries to the list of what to use ?
-
@piervalli did you add these two libraries to the list of what to use ?
wrote on 19 Dec 2023, 12:59 last edited by piervalliQt Sql Drivers: DB2 (IBM) .............................. no InterBase .............................. yes MySql .................................. no OCI (Oracle) ........................... no ODBC ................................... no PostgreSQL ............................. yes SQLite2 ................................ no SQLite ................................. yes Using system provided SQLite ......... no TDS (Sybase) ........................... no
Nice next step, in the folder libs there are static and dynamic libray, now I have delete the static lib.
-
Qt Sql Drivers: DB2 (IBM) .............................. no InterBase .............................. yes MySql .................................. no OCI (Oracle) ........................... no ODBC ................................... no PostgreSQL ............................. yes SQLite2 ................................ no SQLite ................................. yes Using system provided SQLite ......... no TDS (Sybase) ........................... no
Nice next step, in the folder libs there are static and dynamic libray, now I have delete the static lib.
@piervalli Nice !
Don't forget to properly firewall and lock your database. Having such a direction connection is pretty risky if you do it over internet.
1/7