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. Lnk error ndk native android
Forum Updated to NodeBB v4.3 + New Features

Lnk error ndk native android

Scheduled Pinned Locked Moved Solved Mobile and Embedded
3 Posts 2 Posters 628 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.
  • JobRecrdJ Offline
    JobRecrdJ Offline
    JobRecrd
    wrote on last edited by JobRecrd
    #1

    I have problems with link ndk native to qt creator. Android for x86 Clang qt 5.12.8.

    My .pro file
       NDKLIB = -L"С:\ndk\21.2.6472646\21.2.6472646\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\lib\i686-linux-android\29"
            LIBS += $$NDKLIB\libc.a
            LIBS += $$NDKLIB\libcompiler_rt-extras.a
            LIBS += $$NDKLIB\libdl.a
            LIBS += $$NDKLIB\libm.a
            LIBS += $$NDKLIB\libstdc++.a
            LIBS += $$NDKLIB\libz.a
            LIBS += $$NDKLIB\libmediandk.so
            LIBS += $$NDKLIB\libnativewindow.so
            LIBS += $$NDKLIB\libdl.so
            LIBS += $$NDKLIB\libandroid.so
            LIBS += $$NDKLIB\libGLESv2.so
            LIBS += $$NDKLIB\libstdc++.so
            LIBS += $$NDKLIB\libbinder_ndk.so
            LIBS += $$NDKLIB\libGLESv3.so
            LIBS += $$NDKLIB\libsync.so
            LIBS += $$NDKLIB\libjnigraphics.so
            LIBS += $$NDKLIB\libvulkan.so
            LIBS += $$NDKLIB\libc.so
            LIBS += $$NDKLIB\libz.so
    

    Compile Output

    error: undefined reference to 'ACameraManager_delete'
    error: undefined reference to 'ACameraManager_getCameraIdList'
    error: undefined reference to 'ACameraManager_getCameraCharacteristics'
    error: undefined reference to 'ACameraMetadata_getConstEntry'
    error: undefined reference to 'ACameraManager_deleteCameraIdList'
    error: undefined reference to 'AImageReader_setImageListener'
    error: undefined reference to 'AImageReader_new'
    error: undefined reference to 'AImageReader_setImageListener'
    error: undefined reference to 'AImageReader_getWindow'
    error: undefined reference to 'ACaptureSessionOutput_create'
    
    jsulmJ 1 Reply Last reply
    0
    • JobRecrdJ JobRecrd

      I have problems with link ndk native to qt creator. Android for x86 Clang qt 5.12.8.

      My .pro file
         NDKLIB = -L"С:\ndk\21.2.6472646\21.2.6472646\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\lib\i686-linux-android\29"
              LIBS += $$NDKLIB\libc.a
              LIBS += $$NDKLIB\libcompiler_rt-extras.a
              LIBS += $$NDKLIB\libdl.a
              LIBS += $$NDKLIB\libm.a
              LIBS += $$NDKLIB\libstdc++.a
              LIBS += $$NDKLIB\libz.a
              LIBS += $$NDKLIB\libmediandk.so
              LIBS += $$NDKLIB\libnativewindow.so
              LIBS += $$NDKLIB\libdl.so
              LIBS += $$NDKLIB\libandroid.so
              LIBS += $$NDKLIB\libGLESv2.so
              LIBS += $$NDKLIB\libstdc++.so
              LIBS += $$NDKLIB\libbinder_ndk.so
              LIBS += $$NDKLIB\libGLESv3.so
              LIBS += $$NDKLIB\libsync.so
              LIBS += $$NDKLIB\libjnigraphics.so
              LIBS += $$NDKLIB\libvulkan.so
              LIBS += $$NDKLIB\libc.so
              LIBS += $$NDKLIB\libz.so
      

      Compile Output

      error: undefined reference to 'ACameraManager_delete'
      error: undefined reference to 'ACameraManager_getCameraIdList'
      error: undefined reference to 'ACameraManager_getCameraCharacteristics'
      error: undefined reference to 'ACameraMetadata_getConstEntry'
      error: undefined reference to 'ACameraManager_deleteCameraIdList'
      error: undefined reference to 'AImageReader_setImageListener'
      error: undefined reference to 'AImageReader_new'
      error: undefined reference to 'AImageReader_setImageListener'
      error: undefined reference to 'AImageReader_getWindow'
      error: undefined reference to 'ACaptureSessionOutput_create'
      
      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by jsulm
      #2

      @JobRecrd I don't think you need -L for static linking:

      LIBS += "С:/ndk/21.2.6472646/21.2.6472646/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/i686-linux-android/29"
              LIBS += $$NDKLIB\libc.a
              LIBS += $$NDKLIB\libcompiler_rt-extras.a
              LIBS += $$NDKLIB\libdl.a
              LIBS += $$NDKLIB\libm.a
              LIBS += $$NDKLIB\libstdc++.a
              LIBS += $$NDKLIB\libz.a
              LIBS += -L$$NDKLIB -lmediandk
              LIBS += -L$$NDKLIB -lnativewindow
              LIBS += -L$$NDKLIB -ldl
              LIBS += -L$$NDKLIB -landroid
              LIBS += -L$$NDKLIB -lGLESv2
              LIBS += -L$$NDKLIB -lstdc++
              LIBS += -L$$NDKLIB -lbinder_ndk
              LIBS += -L$$NDKLIB -lGLESv3
              LIBS += -L$$NDKLIB -lsync
              LIBS += -L$$NDKLIB -ljnigraphics
              LIBS += -L$$NDKLIB -lvulkan
              LIBS += -L$$NDKLIB -lc
              LIBS += -L$$NDKLIB -lz
      

      Also you should use / instead of \ in pro files even on Windows.
      I'm wondering why you actually need to do this? Why do you link explicitly libc.so for example? And you're linking static and shared versions of libc!
      Can you explain what you are trying to do?

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

      JobRecrdJ 1 Reply Last reply
      1
      • jsulmJ jsulm

        @JobRecrd I don't think you need -L for static linking:

        LIBS += "С:/ndk/21.2.6472646/21.2.6472646/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/i686-linux-android/29"
                LIBS += $$NDKLIB\libc.a
                LIBS += $$NDKLIB\libcompiler_rt-extras.a
                LIBS += $$NDKLIB\libdl.a
                LIBS += $$NDKLIB\libm.a
                LIBS += $$NDKLIB\libstdc++.a
                LIBS += $$NDKLIB\libz.a
                LIBS += -L$$NDKLIB -lmediandk
                LIBS += -L$$NDKLIB -lnativewindow
                LIBS += -L$$NDKLIB -ldl
                LIBS += -L$$NDKLIB -landroid
                LIBS += -L$$NDKLIB -lGLESv2
                LIBS += -L$$NDKLIB -lstdc++
                LIBS += -L$$NDKLIB -lbinder_ndk
                LIBS += -L$$NDKLIB -lGLESv3
                LIBS += -L$$NDKLIB -lsync
                LIBS += -L$$NDKLIB -ljnigraphics
                LIBS += -L$$NDKLIB -lvulkan
                LIBS += -L$$NDKLIB -lc
                LIBS += -L$$NDKLIB -lz
        

        Also you should use / instead of \ in pro files even on Windows.
        I'm wondering why you actually need to do this? Why do you link explicitly libc.so for example? And you're linking static and shared versions of libc!
        Can you explain what you are trying to do?

        JobRecrdJ Offline
        JobRecrdJ Offline
        JobRecrd
        wrote on last edited by
        #3

        @jsulm
        I needed to access the camera on the android platform. Your answer helped solve my problem, thanks.

        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