【问题标题】:ndk-build gstreamer android tutorial: cannot find -lrtndk-build gstreamer android 教程:找不到-lrt
【发布时间】:2015-03-05 02:43:27
【问题描述】:

我正在关注教程 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

【问题讨论】:

  • 你能展示你的 Android.mk 吗?
  • 尝试替换为:LOCAL_LDLIBS := -llog -landroid $(APP_LDLIBS)

标签: android c android-ndk gstreamer


【解决方案1】:

LOCAL_LDLIBS := -llog

LOCAL_LDLIBS := -llog -landroid

【讨论】:

    【解决方案2】:

    Android 没有 librt。都在 libc 中。

    大概include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer.mk 正在将-lrt 添加到ldlibs。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-05-16
      • 1970-01-01
      • 2023-03-20
      • 2013-12-08
      • 2019-09-11
      • 2014-04-10
      • 1970-01-01
      相关资源
      最近更新 更多