title: cannot find libmediandk.so with LOCAL_LDLIBS += -lmediandk. Android native shared library with ndk-build
body: <p>Why can I not find libmediandk.so with the following command in the Android.mk file:</p>
  
  <pre><code>LOCAL_LDLIBS    += -lmediandk
  </code></pre>
  
  <p><strong>Application.mk</strong></p>
  
  <pre><code>NDK_TOOLCHAIN_VERSION := 4.9
  APP_ABI := x86
  </code></pre>
  
  <p><strong>Android.mk</strong></p>
  
  <pre><code>LOCAL_PATH := $(call my-dir)
  
  include $(CLEAR_VARS)
  LOCAL_CFLAGS += -std=c++11
  LOCAL_CFLAGS    += -UNDEBUG
  LOCAL_LDLIBS    += -lmediandk
  LOCAL_LDLIBS    += -OpenMAXAL
  LOCAL_LDLIBS    += -landroid 
  LOCAL_SHARED_LIBRARIES += libmediandk
  LOCAL_LDLIBS    += -llog
  CC=/home/c/Downloads/Openglxmlfour/i686-linux-android/bin/i686-linux-android-gcc
  CXX=CC=/home/c/Downloads/Openglxmlfour/i686-linux-android/bin/i686-linux-android-g++
  LOCAL_MODULE    := native-codec-jni  # name your module here.
  LOCAL_SRC_FILES := native-codec-jni.cpp looper.cpp
  LOCAL_C_INCLUDES=/home/c/Android/Sdk/ndk-bundle/platforms/android-21/arch-x86/usr/include
  include $(BUILD_SHARED_LIBRARY)
  </code></pre>
  
  <p><strong>Command Line</strong></p>
  
  <pre><code>ndk-build clean &amp;&amp; ndk-build 
  [x86] Clean          : native-codec-jni [x86]
  [x86] Clean          : stdc++ [x86]
  [x86] Compile++      : native-codec-jni &lt;= native-codec-jni.cpp
  [x86] Compile++      : native-codec-jni &lt;= looper.cpp
  [x86] StaticLibrary  : libstdc++.a
  [x86] SharedLibrary  : libnative-codec-jni.so
  /home/c/Android/Sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: cannot find -lmediandk
  
  
  
  
     /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:94: error: undefined reference to 'AMediaCodec_dequeueInputBuffer'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:98: error: undefined reference to 'AMediaCodec_getInputBuffer'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:99: error: undefined reference to 'AMediaExtractor_readSampleData'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:105: error: undefined reference to 'AMediaExtractor_getSampleTime'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:108: error: undefined reference to 'AMediaCodec_queueInputBuffer'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:109: error: undefined reference to 'AMediaExtractor_advance'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:115: error: undefined reference to 'AMediaCodec_dequeueOutputBuffer'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:129: error: undefined reference to 'AMediaCodec_releaseOutputBuffer'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:137: error: undefined reference to 'AMediaCodec_getOutputFormat'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:138: error: undefined reference to 'AMediaFormat_toString'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:139: error: undefined reference to 'AMediaFormat_delete'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:172: error: undefined reference to 'AMediaExtractor_seekTo'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:173: error: undefined reference to 'AMediaCodec_flush'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:161: error: undefined reference to 'AMediaCodec_stop'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:162: error: undefined reference to 'AMediaCodec_delete'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:163: error: undefined reference to 'AMediaExtractor_delete'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:237: error: undefined reference to 'AMediaExtractor_new'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:240: error: undefined reference to 'AMediaExtractor_setDataSourceFd'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:247: error: undefined reference to 'AMediaExtractor_getTrackCount'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:275: error: undefined reference to 'AMediaFormat_delete'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:253: error: undefined reference to 'AMediaExtractor_getTrackFormat'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:254: error: undefined reference to 'AMediaFormat_toString'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:257: error: undefined reference to 'AMEDIAFORMAT_KEY_MIME'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:257: error: undefined reference to 'AMediaFormat_getString'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:263: error: undefined reference to 'AMediaExtractor_selectTrack'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:264: error: undefined reference to 'AMediaCodec_createDecoderByType'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:265: error: undefined reference to 'AMediaCodec_configure'
      /home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/jni/native-codec-jni.cpp:273: error: undefined reference to 'AMediaCodec_start'
      collect2: error: ld returned 1 exit status
      make: *** [/home/c/Downloads/android-ndk-master2/MyApplication/app/src/main/obj/local/x86/libnative-codec-jni.so] Error 1
  </code></pre>