2

1 日半の変更の後、ようやく 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)
4

1 に答える 1

2

次の行を Application.mk に含めてみてください。

APP_CPPFLAGS += -frtti 
APP_CPPFLAGS += -fexceptions

RTTI と例外処理を明示的に有効にする必要があります。

編集 (変更への応答):

# 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
于 2012-05-31T18:11:05.300 に答える