title: How to use C libraries from different path with GCC
body: <p>I am using Android NDK GCC toolchain to compile a project as command-line.
  My gcc location is </p>
  
  <pre><code>/opt/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc
  </code></pre>
  
  <p>And I am using the gcc option</p>
  
  <pre><code>--sysroot=/opt/android-ndk/platforms/android-8/arch-arm/
  </code></pre>
  
  <p>There is no problem when building Hello World. But for this project, during linking, it produces the error:</p>
  
  <pre><code>/opt/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld:
  crtbegin_static.o: No such file: No such file or directory
  </code></pre>
  
  <p>Actually, the "crtbegin_static.o" is located in</p>
  
  <pre><code>/opt/android-ndk/platforms/android-8/arch-arm/usr/lib
  </code></pre>
  
  <p>If I put it to</p>
  
  <pre><code>/opt/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.4.3
  </code></pre>
  
  <p>then this problem can be solved.</p>
  
  <p>Is there anyway to make gcc to locate the <code>crtbegin_static.o</code> correctly.</p>