我的JNI/MyApp的/ Android.mk文件:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := MyApp
LOCAL_SRC_FILES := MyApp.cpp
LOCAL_LDLIBS := -lz
include $(BUILD_SHARED_LIBRARY)
我的JNI/Android.mk
LOCAL_PATH := $(call my-dir)
include $(call all-subdir-makefiles)
我的JNI/MyApp的/ MyApp.cpp中
#include
#include "minizip/unzip.h" #it's in jni/MyApp/minizip/unzip.h
void unzip(char* file, char* folder) {
unzFile zip = unzOpen(file);
}
我jni/Application.mk
APP_MODULES := MyApp
APP_STL := gnustl_static
但是,当我编译:
Gdbserver : [arm-linux-androideabi-4.6] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
SharedLibrary : libMyApp.so
C:/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe:
Z:/workspace/MyApp/obj/local/armeabi/objs-debug/MyApp/MyApp.o: in function unzip(char*, char*):Z:/workspace/MyApp/jni/MyApp/MyApp.cpp:5: error: undefined reference to 'unzOpen' collect2: ld returned 1 exit status make: *** [Z:/workspace/MyApp/obj/local/armeabi/libMyApp.so] Error 1
如果删除行 “unzFile拉链= unzOpen(文件);”它的作品
你能帮我吗? :D
谢谢!
2013-01-24
JoniJnm