c++ - "undefined reference to" error when adding a new module in AOSP -


i'm adding mtp module recovery in android source code. mtp defined shared library (in path frameworks/av/media/mtp/android.mk):

 local_path:= $(call my-dir)  include $(clear_vars)  local_src_files:=                                  \            mtpserver.cpp  \            other sources files                                                   local_module:= libmtp  local_cflags := -dmtp_device -dmtp_host  local_shared_libraries := libutils libcutils liblog libusbhost libbinder  include $(build_shared_library) 

i want use module in recovery, added new module named minmtp in recovery path. android.mk is:

 local_path := $(call my-dir)  include $(clear_vars)  local_module := libminmtp   local_src_files := \     minmtp.cpp \     mymtpdatabase.cpp \   local_shared_libraries += \      libmtp    local_c_includes += \     $(local_path) \     frameworks/av/media/mtp  local_cflags += -dmtp_device -dmtp_host -wall -werror -wno-error=deprecated-declarations   include $(build_static_library)  

i added libminmtp recovery in android.mk:

 local_static_libraries += libminmtp  include $(local_path)/minmtp/android.mk 

it compiled successfully.

but when used class defined in minmtp.cpp in recovery.cpp, compilation failed because of "undefined reference to" errors. undefined reference functions defined in mtpserver.cpp , other source files of android mtp module , used in minmtp.cpp.

i think because linker counld not link libmtp.so, how should modify code make work?


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -