• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
UBports Robot Logo UBports Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Unreferenced function even if it's in a linked library

Scheduled Pinned Locked Moved General
1 Posts 1 Posters 914 Views 1 Watching
Loading More Posts
  • 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.
    • 4 Offline
      4javier
      last edited by 22 Nov 2016, 12:35

      Hi guys.
      I'm blocked with this error:

      target StaticExecutable: sdcard (/home/Ubuntu/javier/dati/download/part-tree/out/target/product/y991/obj/EXECUTABLES/sdcard_intermediates/LINKED/sdcard)
      /home/Ubuntu/javier/dati/download/part-tree/out/target/product/y991/obj/STATIC_LIBRARIES/liblogwrap_intermediates/liblogwrap.a(logwrap.o): In function `do_log_line':
      /home/Ubuntu/javier/dati/download/part-tree/system/core/logwrapper/logwrap.c:160: undefined reference to `klog_write'
      /home/Ubuntu/javier/dati/download/part-tree/system/core/logwrapper/logwrap.c:160: undefined reference to `klog_write'
      /home/Ubuntu/javier/dati/download/part-tree/system/core/logwrapper/logwrap.c:160: undefined reference to `klog_write'
      /home/Ubuntu/javier/dati/download/part-tree/system/core/logwrapper/logwrap.c:160: undefined reference to `klog_write'
      collect2: error: ld returned 1 exit status
      make: *** [/home/Ubuntu/javier/dati/download/part-tree/out/target/product/y991/obj/EXECUTABLES/sdcard_intermediates/LINKED/sdcard] Error 1
      

      This is the interesting part of the Android.mk for liblogwrap

      LOCAL_PATH:= $(call my-dir)
      
      include $(CLEAR_VARS)
      
      # ========================================================
      # Static library
      # ========================================================
      include $(CLEAR_VARS)
      LOCAL_MODULE := liblogwrap
      LOCAL_SRC_FILES := logwrap.c
      LOCAL_SHARED_LIBRARIES := libcutils liblog
      LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
      LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
      LOCAL_CFLAGS := -Werror
      include $(BUILD_STATIC_LIBRARY)
      

      This is the grep matching the function not found inside ./target/product/y991/obj/SHARED_LIBRARIES/libcutils_intermediates/LINKED/libcutils.so

      nm -C ./target/product/y991/obj/SHARED_LIBRARIES/libcutils_intermediates/LINKED/libcutils.so | grep klog_write
      000000000000a504 T klog_write
      

      Why it can't find that?

      1 Reply Last reply Reply Quote 0
      1 out of 1
      • First post
        1/1
        Last post