android ndk 静态库,链接android ndk中的静态库

|

我正在尝试从android ndk示例libs文件夹中的http://developer.nvidia.com/tegra-resources编译nvfile库。无论如何,由于我实际上并不需要整个库套件,因此我抽出了所需的库,其中似乎有依赖关系。这是用于编译它们的Android.mk文件。

include $(CLEAR_VARS)

LOCAL_MODULE := nvthread

LOCAL_CFLAGS := -Wall -g

LOCAL_LDFLAGS := -Wl,-Map,xxx.map

LOCAL_SRC_FILES := nv/nv_thread/nv_thread.c

LOCAL_C_INCLUDES := nv

include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)

LOCAL_MODULE := nvfile

LOCAL_CFLAGS := -Wall -g

LOCAL_LDFLAGS := -Wl,-Map,xxx.map

LOCAL_SRC_FILES := nv/nv_file/nv_file.c

LOCAL_C_INCLUDES := nv

LOCAL_STATIC_LIBRARIES := nvthread nvapkfile

include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)

LOCAL_MODULE := nvapkfile

LOCAL_CFLAGS := -Wall -g

LOCAL_LDFLAGS := -Wl,-Map,xxx.map

LOCAL_SRC_FILES := nv/nv_apk_file/nv_apk_file.c

LOCAL_C_INCLUDES := nv

LOCAL_STATIC_LIBRARIES := nvthread

include $(BUILD_STATIC_LIBRARY)

nvapkfile库似乎可以与nvthread很好地链接,但是nvfile库似乎根本不想链接到nvapkfile库。源代码中的包含文件可以正常工作,只是每当我尝试对其进行编译时,都会得到未定义的引用。这是输出示例:

/home/leif/MarbleMachine/android/obj/local/armeabi/libnvfile.a(nv_file.o): In function `NvFInit\':

/home/leif/MarbleMachine/android/jni/nv/nv_file/nv_file.c:49: undefined reference to `NvAPKInit\'

/home/leif/MarbleMachine/android/obj/local/armeabi/libnvfile.a(nv_file.o): In function `NvFOpen\':

/home/leif/MarbleMachine/android/jni/nv/nv_file/nv_file.c:77: undefined reference to `NvAPKOpen\'

/home/leif/MarbleMachine/android/jni/nv/nv_file/nv_file.c:82: undefined reference to `NvAPKOpen\'

/home/leif/MarbleMachine/android/obj/local/armeabi/libnvfile.a(nv_file.o): In function `NvFClose\':

/home/leif/MarbleMachine/android/jni/nv/nv_file/nv_file.c:97: undefined reference to `NvAPKClose\'

/home/leif/MarbleMachine/android/obj/local/armeabi/libnvfile.a(nv_file.o): In function `NvFGetc\':

/home/leif/MarbleMachine/android/jni/nv/nv_file/nv_file.c:118: undefined reference to `NvAPKGetc\'

/home/leif/MarbleMachine/android/obj/local/armeabi/libnvfile.a(nv_file.o): In function `NvFGets\':

/home/leif/MarbleMachine/android/jni/nv/nv_file/nv_file.c:133: undefined reference to `NvAPKGets\'

/home/leif/MarbleMachine/android/obj/local/armeabi/libnvfile.a(nv_file.o): In function `NvFSize\':

/home/leif/MarbleMachine/android/jni/nv/nv_file/nv_file.c:148: undefined reference to `NvAPKSize\'

/home/leif/MarbleMachine/android/obj/local/armeabi/libnvfile.a(nv_file.o): In function `NvFSeek\':

/home/leif/MarbleMachine/android/jni/nv/nv_file/nv_file.c:171: undefined reference to `NvAPKSeek\'

/home/leif/MarbleMachine/android/obj/local/armeabi/libnvfile.a(nv_file.o): In function `NvFTell\':

/home/leif/MarbleMachine/android/jni/nv/nv_file/nv_file.c:186: undefined reference to `NvAPKTell\'

/home/leif/MarbleMachine/android/obj/local/armeabi/libnvfile.a(nv_file.o): In function `NvFRead\':

/home/leif/MarbleMachine/android/jni/nv/nv_file/nv_file.c:201: undefined reference to `NvAPKRead\'

/home/leif/MarbleMachine/android/obj/local/armeabi/libnvfile.a(nv_file.o): In function `NvFEOF\':

/home/leif/MarbleMachine/android/jni/nv/nv_file/nv_file.c:216: undefined reference to `NvAPKEOF\'

我根本没有修改实际的c或h文件。但作为参考,这里是相关的C文件的一部分:

#include \"nv_file.h\"

#include

#include

#include

#ifdef ANDROID

#include \"../nv_apk_file/nv_apk_file.h\"

#define SUPPORT_APK 1

#include

#endif

//...

void NvFInit()

{

#ifdef SUPPORT_APK

NvAPKInit();

#endif

}

这是nv_file.c的22-32和46-51行

如您所见,标题已包含在内,但没有链接。有人知道我在这里缺少什么吗?谢谢。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值