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.15.2 using SAME builtlibs directory for different ABIs
Forum Updated to NodeBB v4.3 + New Features

Qt 5.15.2 using SAME builtlibs directory for different ABIs

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
6 Posts 3 Posters 428 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.
  • V Offline
    V Offline
    Vince_SiriusXM
    wrote on last edited by
    #1

    I'm trying to build my app using BOTH Armeabi-v7a and Arm64-v8a ABIs; however, I get a failure with the message:

    C:\Users\vbonaventura\AppData\Local\Android\Sdk\ndk\21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/bin/arm-linux-androideabi-ranlib: unable to rename '../../../builtlibs/android/libsxe.a'; reason: File exists
    

    When I got and look to see what the generated makefiles (Makefile.Armeabi-v7a and Makefile.Arm64-v8a) are doing I found this:
    b6e059dd-349b-4c90-85df-6dbecb767f94-image.png

    Which is the EXACT same destination for BOTH and hence the libsxe.a library created there fails since it would need separate libraries for Arm64-v8a and Armeabi-v7a

    Any suggestions?

    jsulmJ J.HilkJ 2 Replies Last reply
    0
    • V Vince_SiriusXM

      I'm trying to build my app using BOTH Armeabi-v7a and Arm64-v8a ABIs; however, I get a failure with the message:

      C:\Users\vbonaventura\AppData\Local\Android\Sdk\ndk\21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/bin/arm-linux-androideabi-ranlib: unable to rename '../../../builtlibs/android/libsxe.a'; reason: File exists
      

      When I got and look to see what the generated makefiles (Makefile.Armeabi-v7a and Makefile.Arm64-v8a) are doing I found this:
      b6e059dd-349b-4c90-85df-6dbecb767f94-image.png

      Which is the EXACT same destination for BOTH and hence the libsxe.a library created there fails since it would need separate libraries for Arm64-v8a and Armeabi-v7a

      Any suggestions?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Vince_SiriusXM Do you do a complete rebuild after switching to another architecture?

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

      V 1 Reply Last reply
      0
      • jsulmJ jsulm

        @Vince_SiriusXM Do you do a complete rebuild after switching to another architecture?

        V Offline
        V Offline
        Vince_SiriusXM
        wrote on last edited by Vince_SiriusXM
        #3

        @jsulm Yes definitely rebuilt from scratch! But I think I found my problem in part... in my defines.pri there is a variable LIBPATH which is used in all subsequent library *.pro files to define where their *.a files will output. Hence when building against 2 architectures there will be conflicts with the generated *.a files.
        Is there a standard way to handle this with Qt? I see that the demo projects use *.so files for their libraries but I can't imagine I can't use static libraries. My understanding is Qt generates 2 executables for Android when selecting 2 architectures but then combines them into 1.

        WARNING: Targets of builds 'Armeabi-v7a' and 'Arm64-v8a' conflict: libsxe.a.
        
        1 Reply Last reply
        0
        • V Vince_SiriusXM

          I'm trying to build my app using BOTH Armeabi-v7a and Arm64-v8a ABIs; however, I get a failure with the message:

          C:\Users\vbonaventura\AppData\Local\Android\Sdk\ndk\21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/bin/arm-linux-androideabi-ranlib: unable to rename '../../../builtlibs/android/libsxe.a'; reason: File exists
          

          When I got and look to see what the generated makefiles (Makefile.Armeabi-v7a and Makefile.Arm64-v8a) are doing I found this:
          b6e059dd-349b-4c90-85df-6dbecb767f94-image.png

          Which is the EXACT same destination for BOTH and hence the libsxe.a library created there fails since it would need separate libraries for Arm64-v8a and Armeabi-v7a

          Any suggestions?

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          @Vince_SiriusXM I'm using

          OBJECTS_DIR = generated/$${ANDROID_TARGET_ARCH}/obj
          

          in my qmake based project. To separate the object files. I'm sure there is something similar for cmake.

          try:

          set(CMAKE_CXX_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/generated/${ANDROID_TARGET_ARCH}/obj)
          

          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          V 1 Reply Last reply
          0
          • J.HilkJ J.Hilk

            @Vince_SiriusXM I'm using

            OBJECTS_DIR = generated/$${ANDROID_TARGET_ARCH}/obj
            

            in my qmake based project. To separate the object files. I'm sure there is something similar for cmake.

            try:

            set(CMAKE_CXX_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/generated/${ANDROID_TARGET_ARCH}/obj)
            
            V Offline
            V Offline
            Vince_SiriusXM
            wrote on last edited by Vince_SiriusXM
            #5

            @J-Hilk said in Qt 5.15.2 using SAME builtlibs directory for different ABIs:

            @Vince_SiriusXM I'm using

            OBJECTS_DIR = generated/$${ANDROID_TARGET_ARCH}/obj
            

            in my qmake based project. To separate the object files. I'm sure there is something similar for cmake.

            try:

            set(CMAKE_CXX_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/generated/${ANDROID_TARGET_ARCH}/obj)
            

            I am not using cmake, I'm using qmake as per QT5.15.2. Thank you for response!
            What file did you add this command to? I assume your project's *.pro file?

            J.HilkJ 1 Reply Last reply
            0
            • V Vince_SiriusXM

              @J-Hilk said in Qt 5.15.2 using SAME builtlibs directory for different ABIs:

              @Vince_SiriusXM I'm using

              OBJECTS_DIR = generated/$${ANDROID_TARGET_ARCH}/obj
              

              in my qmake based project. To separate the object files. I'm sure there is something similar for cmake.

              try:

              set(CMAKE_CXX_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/generated/${ANDROID_TARGET_ARCH}/obj)
              

              I am not using cmake, I'm using qmake as per QT5.15.2. Thank you for response!
              What file did you add this command to? I assume your project's *.pro file?

              J.HilkJ Offline
              J.HilkJ Offline
              J.Hilk
              Moderators
              wrote on last edited by J.Hilk
              #6

              @Vince_SiriusXM
              yes, I have a static library that results in conflicts when compiling for different apks and I found this solution. Haven't had a Problem with it since then.
              Android section of the pro file:

              android {
              #   Android Version code, needs to be upped by 1!
                  ITERATION=24
                  ANDROID_VERSION_CODE = $$ITERATION
              
                  QT += androidextras
                  OBJECTS_DIR = generated/$${ANDROID_TARGET_ARCH}/obj
              
              ....
              
                 LIBS += -L$$OUT_PWD/Dependencies/ThCommunication/ -lThCommunication_$${ANDROID_TARGET_ARCH}
                  PRE_TARGETDEPS += $$OUT_PWD/Dependencies/ThCommunication/libThCommunication_$${ANDROID_TARGET_ARCH}.a
              
              ....
              }
              
              

              Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


              Q: What's that?
              A: It's blue light.
              Q: What does it do?
              A: It turns blue.

              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