gpt4 book ai didi

android - 安卓标签库

转载 作者:IT老高 更新时间:2023-10-28 23:14:58 24 4
gpt4 key购买 nike

我正在尝试为 Android 编译 Taglib。我已经下载了最新版本标签库来自here .在为 arm-linux 构建编译它之后,我已经成功地将它导入到我的应用程序中,但是当我尝试从 tag_c.h 调用任何函数时,我收到以下错误:

SharedLibrary  : taglibwav.so
/home/test/workspacenew/Androidtaglibexample/obj/local/armeabi/
objs/squared/taglibwav.o: In function
`Java_com_android_androidtag_WavFileDetails_taglibwav':
/home/test/workspacenew/Androidtaglibexample/jni/taglibwav.c:30:
undefined reference to `taglib_set_strings_unicode'
collect2: ld returned 1 exit status
make: *** [/home/test/workspacenew/Androidtaglibexample/obj/
local/armeabi/taglibwav.so] Error 1

应用配置信息为:

标签库 ./configure :-

./configure CC="/home/hcl/taglib/taglib/toolchain/bin/arm-linux-androideabi-gcc"\
--host="arm-linux" \
--build="arm" \
--enable-static="no" \
--enable-shared="yes" \
--prefix="/home/test/workspacenew/Androidtaglibexample/jni/testtaglib/"\

Android.mk :-

LOCAL_PATH := $(call my-dir)

#declare the prebuilt library
include $(CLEAR_VARS)
LOCAL_MODULE := taglibtest
LOCAL_SRC_FILES := testtaglib/lib/libtag.a
LOCAL_EXPORT_C_INCLUDES := testtaglib/include/taglib/
LOCAL_PRELINK_MODULE := true
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
include $(call all-subdir-makefiles)
LOCAL_MODULE := taglibwav
LOCAL_SRC_FILES := taglibwav.c
LOCAL_C_INCLUDES := $(LOCAL_PATH)/testtaglib/include/taglib/
LOCAL_SHARED_LIBRARY := taglibtest
LOCAL_LDLIBS := -llog -ljnigraphics -lz -lm -L$(SYSROOT)/usr/lib -llog
include $(BUILD_SHARED_LIBRARY)


Application.mk :-

APP_ABI :=armeabi
APP_STL:=stlport_static


taglibwav.c :-

#include <jni.h>
#include <tag_c.h>
#include <android/log.h>
#ifndef FALSE
#define FALSE 0
#endif
.......
.......
JNIEXPORT void JNICALL Java_com_android_androidtag_WavFileDetails_taglibwav
(JNIEnv * ev, jclass jc){
int i;
int seconds;
int minutes;
TagLib_File *file; //<< accessed form tag_c.h : OK
TagLib_Tag *tag; //<< accessed form tag_c.h : OK
const TagLib_AudioProperties *properties; //<<accessed form tag_c.h : OK
taglib_set_strings_unicode(FALSE);//<<accessed form tag_c.h : GETTING ERROR
}
....
....

Android NDK 版本:- Android-Ndk-r7c

请指导我正确的方向来解决我做错的事情

最佳答案

我想你可能需要 -ltag_c 在某个地方

关于android - 安卓标签库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15887838/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com