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. Problem compiling for Android from Windows
Forum Updated to NodeBB v4.3 + New Features

Problem compiling for Android from Windows

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
androidqt 5.15compilation
8 Posts 4 Posters 1.2k 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.
  • M Offline
    M Offline
    mipr
    wrote on 1 Jul 2022, 13:56 last edited by mipr 7 Jan 2022, 15:05
    #1

    Hi,

    I try to deploy my Windows Qt app on Android but I have problems that my colleagues don't have.

    First issue : we have custom plugins, we build them to have .so files and the compiler copy them inside a folder with other plugin/library files. On my PC, the .so files of my custom plugins are not copied to the dedicated folder during compilation, whereas on my colleagues' PCs this step works. I didn't see any differences between their project and mine.
    When I manually copy custom plugin files in the folder during compilation the APK works and doesn't crash.

    Second issue : after seeing and don't understanding the first issue, I tried to update my Qt Creator (version 6.x.x to 7.0.2) and it's worst. Now, I have errors like :

    error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol ff_cos_32; recompile with -fPIC
    ...
    error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_cos_32 in readonly segment; recompile object files with -fPIC or pass '-WI, -z, notext' to allow text relocations in the output
    

    The complete list of errors :

    ld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol ff_cos_32; recompile with -fPIC
    >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
    >>> referenced by asm.S:491 (./libavutil/aarch64\asm.S:491)
    >>>               fft_neon.o:(fft32_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
    
    ld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_cos_32 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
    >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
    >>> referenced by asm.S:491 (./libavutil/aarch64\asm.S:491)
    >>>               fft_neon.o:(fft32_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
    
    ld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol ff_cos_64; recompile with -fPIC
    >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
    >>> referenced by asm.S:492 (./libavutil/aarch64\asm.S:492)
    >>>               fft_neon.o:(fft64_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
    
    ld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_cos_64 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
    >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
    >>> referenced by asm.S:492 (./libavutil/aarch64\asm.S:492)
    >>>               fft_neon.o:(fft64_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
    
    ld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol ff_cos_128; recompile with -fPIC
    >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
    >>> referenced by asm.S:493 (./libavutil/aarch64\asm.S:493)
    >>>               fft_neon.o:(fft128_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
    
    ld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_cos_128 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
    >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
    >>> referenced by asm.S:493 (./libavutil/aarch64\asm.S:493)
    >>>               fft_neon.o:(fft128_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
    
    ld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol ff_cos_256; recompile with -fPIC
    >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
    >>> referenced by asm.S:494 (./libavutil/aarch64\asm.S:494)
    >>>               fft_neon.o:(fft256_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
    
    ld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_cos_256 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
    >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
    >>> referenced by asm.S:494 (./libavutil/aarch64\asm.S:494)
    >>>               fft_neon.o:(fft256_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
    
    ld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol ff_cos_512; recompile with -fPIC
    >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
    >>> referenced by asm.S:495 (./libavutil/aarch64\asm.S:495)
    >>>               fft_neon.o:(fft512_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
    
    ld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_cos_512 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
    >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
    >>> referenced by asm.S:495 (./libavutil/aarch64\asm.S:495)
    >>>               fft_neon.o:(fft512_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
    
    ld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol ff_cos_1024; recompile with -fPIC
    >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
    >>> referenced by asm.S:496 (./libavutil/aarch64\asm.S:496)
    >>>               fft_neon.o:(fft1024_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
    
    ld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_cos_1024 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
    >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
    >>> referenced by asm.S:496 (./libavutil/aarch64\asm.S:496)
    >>>               fft_neon.o:(fft1024_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
    
    ld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol ff_cos_2048; recompile with -fPIC
    >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
    >>> referenced by asm.S:497 (./libavutil/aarch64\asm.S:497)
    >>>               fft_neon.o:(fft2048_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
    
    ld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_cos_2048 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
    >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
    >>> referenced by asm.S:497 (./libavutil/aarch64\asm.S:497)
    >>>               fft_neon.o:(fft2048_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
    
    ld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol ff_cos_4096; recompile with -fPIC
    >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
    >>> referenced by asm.S:498 (./libavutil/aarch64\asm.S:498)
    >>>               fft_neon.o:(fft4096_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
    
    ld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_cos_4096 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
    >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
    >>> referenced by asm.S:498 (./libavutil/aarch64\asm.S:498)
    >>>               fft_neon.o:(fft4096_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
    
    ld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol ff_cos_8192; recompile with -fPIC
    >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
    >>> referenced by asm.S:499 (./libavutil/aarch64\asm.S:499)
    >>>               fft_neon.o:(fft8192_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
    
    ld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_cos_8192 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
    >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
    >>> referenced by asm.S:499 (./libavutil/aarch64\asm.S:499)
    >>>               fft_neon.o:(fft8192_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
    
    ld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol ff_cos_16384; recompile with -fPIC
    >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
    >>> referenced by asm.S:500 (./libavutil/aarch64\asm.S:500)
    >>>               fft_neon.o:(fft16384_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
    
    ld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_cos_16384 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
    >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
    >>> referenced by asm.S:500 (./libavutil/aarch64\asm.S:500)
    >>>               fft_neon.o:(fft16384_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
    
    ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
    

    I tried to put -fPIC argument inside each steps of my android build steps but the argument is never known, I don't know where to put it.

    My build steps are :

    • qmake: qmake.exe App.pro
    • Make: make.exe -j12 in D:\Qt_Projects\App
    • Make install: Copy App Files to D:\Qt_Projects\App\android-build
    • Build Android APK

    Qt Creator version : 7.0.2, Qt version : 5.15.9, OS : Windows 10.

    Do you have an idea ?

    Update :
    The second issue appears when I try to build a plugin. In the generated Makefile of this subproject, it is possible to see the -fPIC argument :

    CFLAGS        = -target aarch64-linux-android21 -fno-limit-debug-info -fPIC -fstack-protector-strong -DANDROID -g -fPIC -Wall -W -D_REENTRANT $(DEFINES)
    CXXFLAGS      = -target aarch64-linux-android21 -fno-limit-debug-info -fPIC -fstack-protector-strong -DANDROID -pthread -g -fPIC -std=gnu++2a -D_REENTRANT $(DEFINES)
    
    J 1 Reply Last reply 9 Jan 2024, 03:12
    0
    • M mipr
      1 Jul 2022, 13:56

      Hi,

      I try to deploy my Windows Qt app on Android but I have problems that my colleagues don't have.

      First issue : we have custom plugins, we build them to have .so files and the compiler copy them inside a folder with other plugin/library files. On my PC, the .so files of my custom plugins are not copied to the dedicated folder during compilation, whereas on my colleagues' PCs this step works. I didn't see any differences between their project and mine.
      When I manually copy custom plugin files in the folder during compilation the APK works and doesn't crash.

      Second issue : after seeing and don't understanding the first issue, I tried to update my Qt Creator (version 6.x.x to 7.0.2) and it's worst. Now, I have errors like :

      error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol ff_cos_32; recompile with -fPIC
      ...
      error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_cos_32 in readonly segment; recompile object files with -fPIC or pass '-WI, -z, notext' to allow text relocations in the output
      

      The complete list of errors :

      ld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol ff_cos_32; recompile with -fPIC
      >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
      >>> referenced by asm.S:491 (./libavutil/aarch64\asm.S:491)
      >>>               fft_neon.o:(fft32_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
      
      ld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_cos_32 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
      >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
      >>> referenced by asm.S:491 (./libavutil/aarch64\asm.S:491)
      >>>               fft_neon.o:(fft32_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
      
      ld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol ff_cos_64; recompile with -fPIC
      >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
      >>> referenced by asm.S:492 (./libavutil/aarch64\asm.S:492)
      >>>               fft_neon.o:(fft64_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
      
      ld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_cos_64 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
      >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
      >>> referenced by asm.S:492 (./libavutil/aarch64\asm.S:492)
      >>>               fft_neon.o:(fft64_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
      
      ld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol ff_cos_128; recompile with -fPIC
      >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
      >>> referenced by asm.S:493 (./libavutil/aarch64\asm.S:493)
      >>>               fft_neon.o:(fft128_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
      
      ld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_cos_128 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
      >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
      >>> referenced by asm.S:493 (./libavutil/aarch64\asm.S:493)
      >>>               fft_neon.o:(fft128_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
      
      ld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol ff_cos_256; recompile with -fPIC
      >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
      >>> referenced by asm.S:494 (./libavutil/aarch64\asm.S:494)
      >>>               fft_neon.o:(fft256_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
      
      ld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_cos_256 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
      >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
      >>> referenced by asm.S:494 (./libavutil/aarch64\asm.S:494)
      >>>               fft_neon.o:(fft256_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
      
      ld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol ff_cos_512; recompile with -fPIC
      >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
      >>> referenced by asm.S:495 (./libavutil/aarch64\asm.S:495)
      >>>               fft_neon.o:(fft512_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
      
      ld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_cos_512 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
      >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
      >>> referenced by asm.S:495 (./libavutil/aarch64\asm.S:495)
      >>>               fft_neon.o:(fft512_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
      
      ld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol ff_cos_1024; recompile with -fPIC
      >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
      >>> referenced by asm.S:496 (./libavutil/aarch64\asm.S:496)
      >>>               fft_neon.o:(fft1024_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
      
      ld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_cos_1024 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
      >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
      >>> referenced by asm.S:496 (./libavutil/aarch64\asm.S:496)
      >>>               fft_neon.o:(fft1024_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
      
      ld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol ff_cos_2048; recompile with -fPIC
      >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
      >>> referenced by asm.S:497 (./libavutil/aarch64\asm.S:497)
      >>>               fft_neon.o:(fft2048_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
      
      ld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_cos_2048 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
      >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
      >>> referenced by asm.S:497 (./libavutil/aarch64\asm.S:497)
      >>>               fft_neon.o:(fft2048_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
      
      ld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol ff_cos_4096; recompile with -fPIC
      >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
      >>> referenced by asm.S:498 (./libavutil/aarch64\asm.S:498)
      >>>               fft_neon.o:(fft4096_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
      
      ld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_cos_4096 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
      >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
      >>> referenced by asm.S:498 (./libavutil/aarch64\asm.S:498)
      >>>               fft_neon.o:(fft4096_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
      
      ld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol ff_cos_8192; recompile with -fPIC
      >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
      >>> referenced by asm.S:499 (./libavutil/aarch64\asm.S:499)
      >>>               fft_neon.o:(fft8192_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
      
      ld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_cos_8192 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
      >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
      >>> referenced by asm.S:499 (./libavutil/aarch64\asm.S:499)
      >>>               fft_neon.o:(fft8192_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
      
      ld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol ff_cos_16384; recompile with -fPIC
      >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
      >>> referenced by asm.S:500 (./libavutil/aarch64\asm.S:500)
      >>>               fft_neon.o:(fft16384_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
      
      ld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_cos_16384 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
      >>> defined in D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a(fft_float.o)
      >>> referenced by asm.S:500 (./libavutil/aarch64\asm.S:500)
      >>>               fft_neon.o:(fft16384_neon) in archive D:\gstreamer\gstreamer-1.0-android-universal-1.20.1\arm64/lib\libavcodec.a
      
      ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
      

      I tried to put -fPIC argument inside each steps of my android build steps but the argument is never known, I don't know where to put it.

      My build steps are :

      • qmake: qmake.exe App.pro
      • Make: make.exe -j12 in D:\Qt_Projects\App
      • Make install: Copy App Files to D:\Qt_Projects\App\android-build
      • Build Android APK

      Qt Creator version : 7.0.2, Qt version : 5.15.9, OS : Windows 10.

      Do you have an idea ?

      Update :
      The second issue appears when I try to build a plugin. In the generated Makefile of this subproject, it is possible to see the -fPIC argument :

      CFLAGS        = -target aarch64-linux-android21 -fno-limit-debug-info -fPIC -fstack-protector-strong -DANDROID -g -fPIC -Wall -W -D_REENTRANT $(DEFINES)
      CXXFLAGS      = -target aarch64-linux-android21 -fno-limit-debug-info -fPIC -fstack-protector-strong -DANDROID -pthread -g -fPIC -std=gnu++2a -D_REENTRANT $(DEFINES)
      
      J Offline
      J Offline
      julianoes
      wrote on 9 Jan 2024, 03:12 last edited by
      #2

      @mipr I ran into exactly the same problem. Did you ever find a solution?

      JoeCFDJ 1 Reply Last reply 9 Jan 2024, 04:49
      0
      • J julianoes
        9 Jan 2024, 03:12

        @mipr I ran into exactly the same problem. Did you ever find a solution?

        JoeCFDJ Offline
        JoeCFDJ Offline
        JoeCFD
        wrote on 9 Jan 2024, 04:49 last edited by JoeCFD 1 Sept 2024, 04:52
        #3
        This post is deleted!
        J 1 Reply Last reply 9 Jan 2024, 21:04
        0
        • JoeCFDJ JoeCFD
          9 Jan 2024, 04:49

          This post is deleted!

          J Offline
          J Offline
          julianoes
          wrote on 9 Jan 2024, 21:04 last edited by
          #4

          @JoeCFD I don't think qtcreator vs. qmake should make a difference. Plus, it eventually needs to work in CI anyway.

          I assume it has to do with the gstreamer libraries that I'm trying to link to.

          JoeCFDJ 1 Reply Last reply 9 Jan 2024, 21:35
          0
          • J julianoes
            9 Jan 2024, 21:04

            @JoeCFD I don't think qtcreator vs. qmake should make a difference. Plus, it eventually needs to work in CI anyway.

            I assume it has to do with the gstreamer libraries that I'm trying to link to.

            JoeCFDJ Offline
            JoeCFDJ Offline
            JoeCFD
            wrote on 9 Jan 2024, 21:35 last edited by JoeCFD 1 Sept 2024, 21:38
            #5

            @julianoes OK. I guess Version 6 and 7 of qtcreator are too old. Try to use higher versions. Are you linking gstreamer to your plugin or your app?
            If you have to put your own plugin into a specific dir, I do not think it is a problem since your app looks for your plugin in that dir. If you put it somewhere else, your app will not work.

            J 1 Reply Last reply 10 Jan 2024, 22:06
            0
            • JoeCFDJ JoeCFD
              9 Jan 2024, 21:35

              @julianoes OK. I guess Version 6 and 7 of qtcreator are too old. Try to use higher versions. Are you linking gstreamer to your plugin or your app?
              If you have to put your own plugin into a specific dir, I do not think it is a problem since your app looks for your plugin in that dir. If you put it somewhere else, your app will not work.

              J Offline
              J Offline
              julianoes
              wrote on 10 Jan 2024, 22:06 last edited by
              #6

              @JoeCFD have you read what I wrote? I'm using Qt6 and qmake that comes with it. Nothing about qtcreator.

              1 Reply Last reply
              0
              • K Offline
                K Offline
                Kim Nancy
                wrote on 11 Jan 2024, 08:09 last edited by
                #7

                Hi! Ensure project settings match your colleagues' for custom plugin copying. Check the plugin's Makefile for the -fPIC argument to address errors after updating Qt Creator. Maintain compatibility between Qt versions and plugin requirements. Seek assistance on Qt community forums for further support.

                J 1 Reply Last reply 11 Jan 2024, 21:40
                0
                • K Kim Nancy
                  11 Jan 2024, 08:09

                  Hi! Ensure project settings match your colleagues' for custom plugin copying. Check the plugin's Makefile for the -fPIC argument to address errors after updating Qt Creator. Maintain compatibility between Qt versions and plugin requirements. Seek assistance on Qt community forums for further support.

                  J Offline
                  J Offline
                  julianoes
                  wrote on 11 Jan 2024, 21:40 last edited by
                  #8

                  @Kim-Nancy said in Problem compiling for Android from Windows:

                  Seek assistance on Qt community forums for further support.

                  Ha, that's literally where we are.

                  In any case, this solved it for me: https://stackoverflow.com/a/68394638/8548472.

                  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