为了测试刚编译好的ffmpeg库,就是用了如下例子
jni:
jstring
Java_com_example_hellojni_HelloJni_stringFromJNI( JNIEnv* env,
jobject thiz )
{
//av_register_all();
char str[25];
sprintf(str, “%d”, avcodec_version());
return (*env)->NewStringUTF(env, str);
}
但用ndk编译时出现如下问题
[armeabi-v7a] Compile thumb : hello-jni <= hello-jni.c
[armeabi-v7a] SharedLibrary : libhello-jni.so
D:/ndk/android-ndk-r9d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin
/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.e
xe: ./obj/local/armeabi-v7a/objs-debug/hello-jni/hello-jni.o: in function Java_c
om_example_hellojni_HelloJni_stringFromJNI:jni/hello-jni.c:39: error: undefined
reference to “”avcodec_version””
collect2: ld returned 1 exit status
/cygdrive/d/ndk/android-ndk-r9d/build/core/build-binary.mk:588: recipe for targe
t “”obj/local/armeabi-v7a/libhello-jni.so”” failed
make: *** [obj/local/armeabi-v7a/libhello-jni.so] Error 1
都是按照步骤来的,感觉没问题,求高手们指点
jni:
jstring
Java_com_example_hellojni_HelloJni_stringFromJNI( JNIEnv* env,
jobject thiz )
{
//av_register_all();
char str[25];
sprintf(str, “%d”, avcodec_version());
return (*env)->NewStringUTF(env, str);
}
但用ndk编译时出现如下问题
[armeabi-v7a] Compile thumb : hello-jni <= hello-jni.c
[armeabi-v7a] SharedLibrary : libhello-jni.so
D:/ndk/android-ndk-r9d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin
/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.e
xe: ./obj/local/armeabi-v7a/objs-debug/hello-jni/hello-jni.o: in function Java_c
om_example_hellojni_HelloJni_stringFromJNI:jni/hello-jni.c:39: error: undefined
reference to “”avcodec_version””
collect2: ld returned 1 exit status
/cygdrive/d/ndk/android-ndk-r9d/build/core/build-binary.mk:588: recipe for targe
t “”obj/local/armeabi-v7a/libhello-jni.so”” failed
make: *** [obj/local/armeabi-v7a/libhello-jni.so] Error 1
都是按照步骤来的,感觉没问题,求高手们指点