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. Platform suffix without specifying it in the .pro files

Platform suffix without specifying it in the .pro files

Scheduled Pinned Locked Moved Solved Installation and Deployment
8 Posts 2 Posters 657 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.
  • G Offline
    G Offline
    genner
    wrote on last edited by
    #1

    Hi all,

    I am trying to compile an application both for Linux Desktop and for Android.

    For some reason, when compiling for Android, even if in my TARGET variable there is written mylibrary, the output of the compilation process is mylibrary_ARCHITECTURE.so

    is it possible to remove this forced extension somehow?

    I have also tried to add this

        android{
          EXTENSION = _$${QT_ARCH}.so
          LIBS += -lmy_lib$$EXTENSION
        }else {
          LIBS += -lmy_lib
        }
    

    but I have got issues when linking the library to a test like:

    ....Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -target aarch64-linux-android23 -fno-limit-debug-info -Wl,-soname,libtest_my_lib_arm64-v8a.so -Wl,--build-id=sha1 -Wl,--no-undefined -Wl,-z,noexecstack -shared -o ../bin/libtest_my_lib_arm64-v8a.so  ../build/main.o   -L/home/test/my_lib/lib -lmy_lib_arm64-v8a.so /opt/Qt/6.3.0/android_arm64_v8a/lib/libQt6Core_arm64-v8a.so -llog -pthread   -llog -lz -lm -ldl -lc
    ld: error: unable to find library -lmy_lib_arm64-v8a.so
    

    Any hints?

    1 Reply Last reply
    0
    • JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by
      #2
      This post is deleted!
      1 Reply Last reply
      0
      • JoeCFDJ Offline
        JoeCFDJ Offline
        JoeCFD
        wrote on last edited by JoeCFD
        #3

        where is your lib located? I think the paths to the lib are different in both builds. You may need to add the paths after -L as well.

        G 1 Reply Last reply
        0
        • JoeCFDJ JoeCFD

          where is your lib located? I think the paths to the lib are different in both builds. You may need to add the paths after -L as well.

          G Offline
          G Offline
          genner
          wrote on last edited by
          #4

          @JoeCFD

          thank you for your reply.

          I am using the -L flag too. In fact, if I compile for Desktop only it works. It is a really strange behavior

          JoeCFDJ 1 Reply Last reply
          0
          • G genner

            @JoeCFD

            thank you for your reply.

            I am using the -L flag too. In fact, if I compile for Desktop only it works. It is a really strange behavior

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

            @genner sorry You have to add it to Android project with
            LIBS += fullpath/libname.so

            do not forget to add it to here as well.
            ANDROID_EXTRA_LIBS =

            G 1 Reply Last reply
            1
            • JoeCFDJ JoeCFD

              @genner sorry You have to add it to Android project with
              LIBS += fullpath/libname.so

              do not forget to add it to here as well.
              ANDROID_EXTRA_LIBS =

              G Offline
              G Offline
              genner
              wrote on last edited by
              #6

              @JoeCFD Thank you. It is still not working (it does not find the library). I am going to investigate more, but I find it really strange that it is not possible to leave the TARGET with the name I want

              JoeCFDJ 1 Reply Last reply
              0
              • G genner

                @JoeCFD Thank you. It is still not working (it does not find the library). I am going to investigate more, but I find it really strange that it is not possible to leave the TARGET with the name I want

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

                @genner
                one example in my pro file and make sure the path is correct. Print it out with message to the terminal.
                LIBS += $$ANDROID_SDK_ROOT/android_openssl/latest/arm64/libssl_1_1.so

                1 Reply Last reply
                1
                • G Offline
                  G Offline
                  genner
                  wrote on last edited by
                  #8

                  Ok thank you.

                  I think I have understood what was the issue.

                  I added with the -l also the final .so

                  Thank you again

                  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