我正在关注教程 http://docs.gstreamer.com/display/GstSDK/Installing+for+Android+development
我想使用ndk-build
来构建示例。
当我使用"ndk-build"
时,会出现错误消息。
以下是输出消息:
GStreamer : [GEN] => gst-build/gstreamer_android.c
GStreamer : [COMPILE] => gst-build/gstreamer_android.c
GStreamer : [LINK] => gst-build/libgstreamer_android.so
/home/quanta/tools/android-ndk-r9d/toolchains/arm-linux-androideabi-
4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.gold: error: cannot find -lrt
collect2:ld返回1退出状态
make:*** [buildsharedlibrary]错误1
我在ubuntu linux 64bit 12.04中使用ndk-r9d
非常感谢任何建议。
添加Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := tutorial-1
LOCAL_SRC_FILES := tutorial-1.c
LOCAL_SHARED_LIBRARIES := gstreamer_android
LOCAL_LDLIBS := -llog
include $(BUILD_SHARED_LIBRARY)
ifndef GSTREAMER_SDK_ROOT
ifndef GSTREAMER_SDK_ROOT_ANDROID
$(error GSTREAMER_SDK_ROOT_ANDROID is not defined!)
endif
GSTREAMER_SDK_ROOT := $(GSTREAMER_SDK_ROOT_ANDROID)
endif
GSTREAMER_NDK_BUILD_PATH := $(GSTREAMER_SDK_ROOT)/share/gst-android/ndk- build/
GSTREAMER_PLUGINS := coreelements
include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer.mk
答案 0 :(得分:0)
LOCAL_LDLIBS:= -llog
到
LOCAL_LDLIBS:= -llog -landroid
答案 1 :(得分:0)
Android没有librt。这一切都在libc。
据推测,include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer.mk
正在向{ldlibs添加-lrt
。