title: cross compiling why cant ld find shared library / how to debug further?
body: <p>Im trying to cross-compile and link aggregate on ubuntu for my arm-router and I get the following error.  In the past I think I have been able to workaround this by setting the appropriate environment variable but this time is not working .  Can anyone help me figure out why this might not work:</p>
  
  <p><code>/home/ubuntu/Downloads/toolchain-arm_cortex-a9_gcc-4.9-linaro_musl-1.1.2_eabi/bin/../lib64/gcc/arm-openwrt-linux-muslgnueabi/4.9.1/../../../../arm-openwrt-linux-muslgnueabi/bin/ld:</code> </p>
  
  <p><code>cannot find -lpopt</code></p>
  
  <p>however libpopt.so exists in :
  <code>lrwxrwxrwx 1 root root 34 Sep 10 12:46 /lib/x86_64-linux-gnu/libpopt.so -&gt; /lib/x86_64-linux-gnu/libpopt.so.0</code></p>
  
  <p>I set the following environment variables , in order of desperation, to no avail.</p>
  
  <p><code>LIBRARY_PATH=/lib/x86_64-linux-gnu/
  LD_LIBRARY_PATH=/lib/x86_64-linux-gnu/
  PATH=/lib/x86_64-linux-gnu/:/usr/include/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin</code></p>
  
  <p>Thinking that it might be caused because it might be a target architecture issue (ie maybe i need libpopt.so built for the target of the cross-compile) I copied the libpopt.so from the router to my ubuntu and set the paths again.  Again to no avail.</p>
  
  <p>What might I be doing wrong?</p>
  
  <p>Thanks</p>