经过一天半的修改,我终于让 VLC 项目在 OS X 下几乎可以编译。当它即将链接 libvlcjni.so 时出现以下错误。大约有 100 多个未定义的引用,但大多数是几个函数:
std::__stl_throw_length_error(char const*) std::__node_alloc::_M_deallocate(void*, unsigned int)
有没有人有任何指示?
编译拇指:vlcjni <= aout.c 编译拇指:vlcjni <= pthread-condattr.c 编译拇指:vlcjni <= pthread-rwlocks.c 编译拇指:vlcjni <= eventfd.c 编译拇指:vlcjni <= 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*)'
应用程序.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)