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. Qt 5.13.0 - Build postgres driver for android
Forum Updated to NodeBB v4.3 + New Features

Qt 5.13.0 - Build postgres driver for android

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
21 Posts 4 Posters 3.6k 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.
  • N NickV
    22 Jul 2019, 07:59

    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?

    J Offline
    J Offline
    jsulm
    Lifetime Qt Champion
    wrote on 22 Jul 2019, 10:05 last edited by
    #5

    @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.

    https://forum.qt.io/topic/113070/qt-code-of-conduct

    1 Reply Last reply
    0
    • N Offline
      N Offline
      NickV
      wrote on 22 Jul 2019, 14:07 last edited by
      #6

      Is there a way to build postgres from source for arm?
      Any instructions will be perfect!

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 22 Jul 2019, 19:10 last edited by
        #7

        It's explained in the Wiki page you are using as reference.

        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
        1
        • N Offline
          N Offline
          NickV
          wrote on 23 Jul 2019, 06:55 last edited by
          #8

          When i follow these instruction the libpq.so that produced is not for arm architecture but for x86_64. Maybe there is a problem with the ndk. I don't know for sure.

          J 1 Reply Last reply 23 Jul 2019, 06:59
          0
          • N NickV
            23 Jul 2019, 06:55

            When i follow these instruction the libpq.so that produced is not for arm architecture but for x86_64. Maybe there is a problem with the ndk. I don't know for sure.

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 23 Jul 2019, 06:59 last edited by
            #9

            @NickV This sounds like you're building for x86_64. Can you show the steps you're executing to build it?

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • N Offline
              N Offline
              NickV
              wrote on 23 Jul 2019, 07:12 last edited by NickV
              #10

              @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.2n

              sed -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.shlib

              make -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.

              J 1 Reply Last reply 23 Jul 2019, 07:20
              0
              • N NickV
                23 Jul 2019, 07:12

                @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.2n

                sed -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.shlib

                make -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.

                J Offline
                J Offline
                jsulm
                Lifetime Qt Champion
                wrote on 23 Jul 2019, 07:20 last edited by
                #11

                @NickV How do you build with r18b?

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • N Offline
                  N Offline
                  NickV
                  wrote on 23 Jul 2019, 07:20 last edited by
                  #12

                  @jsulm
                  I am doing exactly the same thing but i use
                  export ANDROID_NDK_ROOT="/<path-to-ndk>/android-ndk-r18b"

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 24 Jul 2019, 19:46 last edited by
                    #13

                    Since you are building for 5.13 you should change to NDK r19 at least.

                    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
                    1
                    • N Offline
                      N Offline
                      NickV
                      wrote on 25 Jul 2019, 06:27 last edited by NickV
                      #14

                      @SGaist
                      I've also tried with android ndk r19c. Still having problems.

                      1 Reply Last reply
                      0
                      • N Offline
                        N Offline
                        NickV
                        wrote on 25 Jul 2019, 11:13 last edited by
                        #15

                        Does postgres supports android 64 bit cpu architectures?

                        J 1 Reply Last reply 25 Jul 2019, 11:16
                        0
                        • N NickV
                          25 Jul 2019, 11:13

                          Does postgres supports android 64 bit cpu architectures?

                          J Offline
                          J Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on 25 Jul 2019, 11:16 last edited by
                          #16

                          @NickV This is something you should ask postgres developers

                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on 26 Jul 2019, 18:58 last edited by
                            #17

                            It should be since it's available on Debian for arm64. However there might be a flag to set somewhere.

                            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
                            • N Offline
                              N Offline
                              Nogood
                              wrote on 13 Apr 2021, 14:31 last edited by
                              #18

                              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.

                              S 1 Reply Last reply 13 Apr 2021, 15:25
                              0
                              • N Nogood
                                13 Apr 2021, 14:31

                                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.

                                S Offline
                                S Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote on 13 Apr 2021, 15:25 last edited by
                                #19

                                @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 ?

                                Interested in AI ? www.idiap.ch
                                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                N 1 Reply Last reply 23 Apr 2021, 09:20
                                0
                                • S SGaist
                                  13 Apr 2021, 15:25

                                  @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 ?

                                  N Offline
                                  N Offline
                                  Nogood
                                  wrote on 23 Apr 2021, 09:20 last edited by
                                  #20

                                  @SGaist said in Qt 5.13.0 - Build postgres driver for android:

                                  guide

                                  Yes, i used guide. But I didn't find the arm-linux-androideabi-gcc file.

                                  everything is fine with the database, the program works well on windows.

                                  1 Reply Last reply
                                  0
                                  • S Offline
                                    S Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on 23 Apr 2021, 19:10 last edited by
                                    #21

                                    Androïd switched to clang.

                                    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