Unreferenced function even if it's in a linked library



  • 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?


Log in to reply
 

Looks like your connection to UBports Forum was lost, please wait while we try to reconnect.