Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. ld errors for arm64-v8a and armeabi-v7a Android builds on x86-64 machine

ld errors for arm64-v8a and armeabi-v7a Android builds on x86-64 machine

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
8 Posts 2 Posters 2.6k Views
  • 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.
  • D Offline
    D Offline
    danilabagroff
    wrote on last edited by
    #1

    Hello, folks!

    I have built Qt5.15.12 for Android on Unbuntu and macOS(both x86_64) and now trying to build an app for 3 archs with 'ANDROID_ABIS=armeabi-v7a arm64-v8a x86_64'

    x86_64 build is compiling and linking without any problems, but on a final step of armeabi-v7a:

    /opt/android-sdk/ndk/23.2.8568313/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ -target armv7a-linux-androideabi33 -fno-limit-debug-info -Wl,--exclude-libs,libunwind.a -Wl,-soname,libqueen-ladybug_armeabi-v7a.so -Wl,-rpath-link=/opt/qt/5.15.12.CE0/android/lib -Wl,--build-id=sha1 -Wl,--no-undefined -Wl,-z,noexecstack -shared -o my_app.so ... /opt/qt/5.15.12.CE0/android/lib/libQt5Core_armeabi-v7a.so -lGLESv2 -llog -lz -lm -ldl -lc
    

    ... and armv64-8a:

    /opt/android-sdk/ndk/23.2.8568313/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ -target aarch64-linux-android33 -fno-limit-debug-info -Wl,-soname,libqueen-ladybug_arm64-v8a.so -Wl,-rpath-link=/opt/qt/5.15.12.CE0/android/lib -Wl,--build-id=sha1 -Wl,--no-undefined -Wl,-z,noexecstack -shared -o my_app.so ... /opt/qt/5.15.12.CE0/android/lib/libQt5Core_arm64-v8a.so -lGLESv2   -llog -lz -lm -ldl -lc
    

    I am facing with ld errors:
    cannot open crtbegin_so.o: No such file or directory
    unable to find library -lGLESv2
    unable to find library -llog
    unable to find library -lc++
    cannot open crtend_so.o: No such file or directory

    Qt was configured on macOS like:

    ./configure -xplatform android-clang \
    -disable-rpath \
    -prefix /opt/qt/5.15.12.CE0/android \
    -android-sdk /opt/android/sdk \
    -android-ndk /opt/android/ndk/r22b \
    -android-ndk-host darwin-x86_64 \
    -sysconfdir /etc/xdg \
    -no-dbus \
    -opengl es2 \
    -no-qpa-platform-guard \
    -sql-sqlite \
    -ssl \
    -I/usr/local/opt/openssl/include \
    -L/usr/local/opt/openssl \
    -nomake tests \
    -nomake examples \
    -verbose \
    -opensource \
    -confirm-license
    

    ...and Ubuntu:

    ./configure -xplatform android-clang \
    -release \
    -prefix /opt/qt/5.15.12.CE0/android \
    -android-sdk /opt/android/sdk \
    -android-ndk /opt/android/ndk/r22b \
    -android-ndk-host linux-x86_64 \
    -sysconfdir /etc/xdg \
    -no-dbus \
    -opengl es2 \
    -sql-sqlite \
    -ssl
    -I/usr/local/opt/openssl/include \
    -L/usr/local/opt/openssl \
    -nomake tests \
    -nomake examples \
    -verbose \
    -opensource \
    -confirm-license
    

    What I am missing?
    Thank you!

    JoeCFDJ 1 Reply Last reply
    0
    • D danilabagroff

      Hello, folks!

      I have built Qt5.15.12 for Android on Unbuntu and macOS(both x86_64) and now trying to build an app for 3 archs with 'ANDROID_ABIS=armeabi-v7a arm64-v8a x86_64'

      x86_64 build is compiling and linking without any problems, but on a final step of armeabi-v7a:

      /opt/android-sdk/ndk/23.2.8568313/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ -target armv7a-linux-androideabi33 -fno-limit-debug-info -Wl,--exclude-libs,libunwind.a -Wl,-soname,libqueen-ladybug_armeabi-v7a.so -Wl,-rpath-link=/opt/qt/5.15.12.CE0/android/lib -Wl,--build-id=sha1 -Wl,--no-undefined -Wl,-z,noexecstack -shared -o my_app.so ... /opt/qt/5.15.12.CE0/android/lib/libQt5Core_armeabi-v7a.so -lGLESv2 -llog -lz -lm -ldl -lc
      

      ... and armv64-8a:

      /opt/android-sdk/ndk/23.2.8568313/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ -target aarch64-linux-android33 -fno-limit-debug-info -Wl,-soname,libqueen-ladybug_arm64-v8a.so -Wl,-rpath-link=/opt/qt/5.15.12.CE0/android/lib -Wl,--build-id=sha1 -Wl,--no-undefined -Wl,-z,noexecstack -shared -o my_app.so ... /opt/qt/5.15.12.CE0/android/lib/libQt5Core_arm64-v8a.so -lGLESv2   -llog -lz -lm -ldl -lc
      

      I am facing with ld errors:
      cannot open crtbegin_so.o: No such file or directory
      unable to find library -lGLESv2
      unable to find library -llog
      unable to find library -lc++
      cannot open crtend_so.o: No such file or directory

      Qt was configured on macOS like:

      ./configure -xplatform android-clang \
      -disable-rpath \
      -prefix /opt/qt/5.15.12.CE0/android \
      -android-sdk /opt/android/sdk \
      -android-ndk /opt/android/ndk/r22b \
      -android-ndk-host darwin-x86_64 \
      -sysconfdir /etc/xdg \
      -no-dbus \
      -opengl es2 \
      -no-qpa-platform-guard \
      -sql-sqlite \
      -ssl \
      -I/usr/local/opt/openssl/include \
      -L/usr/local/opt/openssl \
      -nomake tests \
      -nomake examples \
      -verbose \
      -opensource \
      -confirm-license
      

      ...and Ubuntu:

      ./configure -xplatform android-clang \
      -release \
      -prefix /opt/qt/5.15.12.CE0/android \
      -android-sdk /opt/android/sdk \
      -android-ndk /opt/android/ndk/r22b \
      -android-ndk-host linux-x86_64 \
      -sysconfdir /etc/xdg \
      -no-dbus \
      -opengl es2 \
      -sql-sqlite \
      -ssl
      -I/usr/local/opt/openssl/include \
      -L/usr/local/opt/openssl \
      -nomake tests \
      -nomake examples \
      -verbose \
      -opensource \
      -confirm-license
      

      What I am missing?
      Thank you!

      JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by
      #2

      @danilabagroff It is pretty messy to build qt app for Android. Better to use qt-creator to build your android app.

      unable to find library -lGLESv2
      unable to find library -llog
      unable to find library -lc++
      

      show their paths are not set properly.

      D 2 Replies Last reply
      0
      • JoeCFDJ JoeCFD

        @danilabagroff It is pretty messy to build qt app for Android. Better to use qt-creator to build your android app.

        unable to find library -lGLESv2
        unable to find library -llog
        unable to find library -lc++
        

        show their paths are not set properly.

        D Offline
        D Offline
        danilabagroff
        wrote on last edited by
        #3

        Thank you for join the thread @JoeCFD

        I cannot use QtC because I am trying to setup a pipeline at the CI/CD server.

        JoeCFDJ 1 Reply Last reply
        0
        • JoeCFDJ JoeCFD

          @danilabagroff It is pretty messy to build qt app for Android. Better to use qt-creator to build your android app.

          unable to find library -lGLESv2
          unable to find library -llog
          unable to find library -lc++
          

          show their paths are not set properly.

          D Offline
          D Offline
          danilabagroff
          wrote on last edited by
          #4

          @JoeCFD said in ld errors for arm64-v8a and armeabi-v7a Android builds on x86-64 machine:

          unable to find library -lGLESv2
          unable to find library -llog
          unable to find library -lc++

          Are these libraries supposed to be located somewhere in the sysroot of relevant arch? Could you give me a specific location to check? Thank you :)

          JoeCFDJ 1 Reply Last reply
          0
          • D danilabagroff

            @JoeCFD said in ld errors for arm64-v8a and armeabi-v7a Android builds on x86-64 machine:

            unable to find library -lGLESv2
            unable to find library -llog
            unable to find library -lc++

            Are these libraries supposed to be located somewhere in the sysroot of relevant arch? Could you give me a specific location to check? Thank you :)

            JoeCFDJ Offline
            JoeCFDJ Offline
            JoeCFD
            wrote on last edited by JoeCFD
            #5

            @danilabagroff try to use qt creator in a similar OS and write down the command and env settings for build. Use them in your command line build.

            or
            locate libGLESv2
            locate liblog
            locate libc++
            to find the right paths for these libs and add the paths with -L in front of them in your command.

            1 Reply Last reply
            0
            • D danilabagroff

              Thank you for join the thread @JoeCFD

              I cannot use QtC because I am trying to setup a pipeline at the CI/CD server.

              JoeCFDJ Offline
              JoeCFDJ Offline
              JoeCFD
              wrote on last edited by JoeCFD
              #6

              @danilabagroff Build your app in your local computer with QtCreator and get the command for build from qtcreator output. Run the same command in your server. That is what I am doing.

              D 1 Reply Last reply
              0
              • JoeCFDJ JoeCFD

                @danilabagroff Build your app in your local computer with QtCreator and get the command for build from qtcreator output. Run the same command in your server. That is what I am doing.

                D Offline
                D Offline
                danilabagroff
                wrote on last edited by danilabagroff
                #7

                @JoeCFD This is exactly how I have started - just copy-pasted all commands from QtC on my dev machine(which is macOS/arm64 and can be an important difference, because CI/CD machines are x86_64).

                I have been trying to build a final app a lot against different NDKs and experiencing ld error with 22.1.7171670, **23.**2.8568313 for non x86_64 despite fact that corresponding libraries(GLESv2, log, c++) are exist in all relevant sysroots.

                Finally, I gave a try and successfully had built the test app for all archs against 25.1.8937393 with different warnings and I am not sure that everything(Qt, Android SDK, NDK, Graddle, etc) is legally compatible. Could be this point be a clue? What is the difference between 25.1.8937393 and 22.1.7171670 sysroots?

                I am okay to stay with 25.1 but not sure how to check all dependencies though and cannot simply ignore fact that 22.1.7 is recommended by Qt for Qt5.15.12 itself.

                Best,
                Dani

                JoeCFDJ 1 Reply Last reply
                0
                • D danilabagroff

                  @JoeCFD This is exactly how I have started - just copy-pasted all commands from QtC on my dev machine(which is macOS/arm64 and can be an important difference, because CI/CD machines are x86_64).

                  I have been trying to build a final app a lot against different NDKs and experiencing ld error with 22.1.7171670, **23.**2.8568313 for non x86_64 despite fact that corresponding libraries(GLESv2, log, c++) are exist in all relevant sysroots.

                  Finally, I gave a try and successfully had built the test app for all archs against 25.1.8937393 with different warnings and I am not sure that everything(Qt, Android SDK, NDK, Graddle, etc) is legally compatible. Could be this point be a clue? What is the difference between 25.1.8937393 and 22.1.7171670 sysroots?

                  I am okay to stay with 25.1 but not sure how to check all dependencies though and cannot simply ignore fact that 22.1.7 is recommended by Qt for Qt5.15.12 itself.

                  Best,
                  Dani

                  JoeCFDJ Offline
                  JoeCFDJ Offline
                  JoeCFD
                  wrote on last edited by JoeCFD
                  #8

                  @danilabagroff Try to build your app from command line on your local machine with the commands displayed in qt creator and make sure all env variables are set as in Qt Creator. You are able to see all env variables set in QtCreator.

                  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