编译VLC for Android的问题 - libvlcjni.so

时间:2012-05-31 18:07:57

标签: android c++ c vlc

经过一天半的修改后,我终于得到了VLC项目,几乎在OS X下编译。当它即将链接libvlcjni.so时,我得到以下错误。还有大约100个未定义的引用,但大多数是很少的函数:

std :: __ stl_throw_length_error(char const *) std :: __ node_alloc :: _ M_deallocate(void *,unsigned int)

有没有人有任何指示?

编译拇指:vlcjni&lt; = aout.c 编译拇指:vlcjni&lt; = pthread-condattr.c 编译拇指:vlcjni&lt; = pthread-rwlocks.c 编译拇指:vlcjni&lt; = eventfd.c 编译拇指:vlcjni&lt; = sem.c SharedLibrary:libvlcjni.so ../vlc/android/modules/demux/mkv/.libs/libmkv_plugin.a(libmkv_plugin_la-mkv.o):在函数std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_compare(char const*, char const*, char const*, char const*)': /Android/ndk/sources/cxx-stl/stlport/stlport/stl/_string.h:1076: undefined reference to std :: __ stl_throw_out_of_range(char const *)'

Application.mk

APP_PLATFORM := android-9
ifeq ($(NO_NEON),)
APP_ABI := armeabi-v7a
else ifneq ($(TEGRA2),)
APP_ABI := armeabi-v7a
else
APP_ABI := armeabi
endif

APP_STL := gnustl_static
APP_PLATFORM := android-9
APP_ABI := armeabi-v7a

Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

ifeq ($(NO_NEON),)
ARCH=armeabi-v7a
LOCAL_MODULE    := libvlcjni
else ifneq ($(TEGRA2),)
ARCH=armeabi-v7a
LOCAL_MODULE    := libvlcjni-tegra2
else
ARCH=armeabi
LOCAL_MODULE    := libvlcjni
endif

LOCAL_SRC_FILES := libvlcjni_danmaku.c aout.c pthread-condattr.c pthread-rwlocks.c eventfd.c sem.c

LOCAL_C_INCLUDES := $(VLC_SRC_DIR)/include

ifeq ($(NO_NDK_V7),1)
CPP_STATIC=$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/libs/$(ARCH)/libstdc++.a
else
CPP_STATIC=$(ANDROID_NDK)/sources/cxx-stl/stlport/libs/$(ARCH)/libstlport_static.a
endif

LOCAL_CFLAGS := -std=gnu99
LOCAL_LDLIBS := -L$(VLC_CONTRIB)/lib \
    $(VLC_MODULES) \
    $(VLC_BUILD_DIR)/lib/.libs/libvlc.a \
    $(VLC_BUILD_DIR)/src/.libs/libvlccore.a \
    $(VLC_BUILD_DIR)/compat/.libs/libcompat.a \
    -ldl -lz -lm -llog \
    -ldvbpsi -lebml -lmatroska -ltag \
    -logg -lFLAC -ltheora \
    -lmpeg2 -ldca -la52 \
    -lavformat -lavcodec -lswscale -lavutil -lpostproc -lgsm -lopenjpeg \
    -lliveMedia -lUsageEnvironment -lBasicUsageEnvironment -lgroupsock \
    -lspeex -lspeexdsp \
    -lxml2 -lpng -lgnutls -lgcrypt -lgpg-error -lfreetype -liconv \
    $(CPP_STATIC) 

include $(BUILD_SHARED_LIBRARY)


include $(CLEAR_VARS)

LOCAL_MODULE     := libiomx-gingerbread
LOCAL_SRC_FILES  := ../$(VLC_SRC_DIR)/modules/codec/omxil/iomx.cpp
LOCAL_C_INCLUDES := $(VLC_SRC_DIR)/modules/codec/omxil $(ANDROID_SYS_HEADERS_GINGERBREAD)/frameworks/base/include $(ANDROID_SYS_HEADERS_GINGERBREAD)/system/core/include
LOCAL_LDLIBS     := -L$(ANDROID_LIBS) -lgcc -lstagefright -lmedia -lutils -lbinder

include $(BUILD_SHARED_LIBRARY)

include $(CLEAR_VARS)

LOCAL_MODULE     := libiomx-hc
LOCAL_SRC_FILES  := ../$(VLC_SRC_DIR)/modules/codec/omxil/iomx.cpp
LOCAL_C_INCLUDES := $(VLC_SRC_DIR)/modules/codec/omxil $(ANDROID_SYS_HEADERS_HC)/frameworks/base/include $(ANDROID_SYS_HEADERS_HC)/frameworks/base/native/include $(ANDROID_SYS_HEADERS_HC)/system/core/include $(ANDROID_SYS_HEADERS_HC)/hardware/libhardware/include
LOCAL_LDLIBS     := -L$(ANDROID_LIBS) -lgcc -lstagefright -lmedia -lutils -lbinder

include $(BUILD_SHARED_LIBRARY)

include $(CLEAR_VARS)

LOCAL_MODULE     := libiomx-ics
LOCAL_SRC_FILES  := ../$(VLC_SRC_DIR)/modules/codec/omxil/iomx.cpp
LOCAL_C_INCLUDES := $(VLC_SRC_DIR)/modules/codec/omxil $(ANDROID_SYS_HEADERS_ICS)/frameworks/base/include $(ANDROID_SYS_HEADERS_ICS)/frameworks/base/native/include $(ANDROID_SYS_HEADERS_ICS)/system/core/include $(ANDROID_SYS_HEADERS_ICS)/hardware/libhardware/include
LOCAL_LDLIBS     := -L$(ANDROID_LIBS) -lgcc -lstagefright -lmedia -lutils -lbinder

include $(BUILD_SHARED_LIBRARY)

1 个答案:

答案 0 :(得分:2)

尝试将这些行包含在Application.mk中:

APP_CPPFLAGS += -frtti 
APP_CPPFLAGS += -fexceptions

您必须明确启用RTTI和Exceptions处理。

编辑(对您的修改的回应):

# These are your lines in Application.mk
APP_PLATFORM := android-9
ifeq ($(NO_NEON),)
APP_ABI := armeabi-v7a
else ifneq ($(TEGRA2),)
APP_ABI := armeabi-v7a
else
APP_ABI := armeabi
endif

# Add these lines:
APP_CPPFLAGS += -frtti 
APP_CPPFLAGS += -fexceptions
#  I haven't seen them