我试图在我的原生代码中使用https://ccrma.stanford.edu/software/stk/中的库 并在编译期间我得到错误:未定义的引用(我的外部库的错误链接) 怎么了?
LOCAL_PATH := $(call my-dir)
include $(call all-subdir-makefiles)
include $(CLEAR_VARS)
LOCAL_MODULE := libstk
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libstk.a
#LOCAL_EXPORT_C_INCLUDES :=$(LOCAL_PATH)/stk
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := native-audio-jni
#LOCAL_SRC_FILES := native-audio-jni.cpp
LOCAL_SRC_FILES := \
native-audio-jni.cpp\
sqlite3.c\
mysqlite.h
LOCAL_STATIC_LIBRARIES := libstk
# for native audio
LOCAL_LDLIBS += -lOpenSLES
# for logging
LOCAL_LDLIBS += -llog
# for native asset manager
LOCAL_LDLIBS += -landroid
include $(BUILD_SHARED_LIBRARY)
谢谢
答案 0 :(得分:0)
我认为您忘记为预构建的静态库包含必要的头文件。将它们添加到共享库模块中。