title: "No such file or directory" linker error, LD_LIBRARY_PATH set correctly
body: <p>Some background: I'm using an embedded board (the SolidRun Cubox-i4 Pro), and have installed Ubuntu 14.04 on it using an image obtained on SolidRun's community forums.</p>
  
  <p>This particular board has a Vivante GC2000 graphics driver that advertises OpenCL support. However, the GPU driver is proving to be a pain. I found binaries for all the required libraries, but when I try to run a small test executable built against them, I get this familiar error:</p>
  
  <pre><code>cubox@cubox:~/cltest$ g++ cltest.cpp -lOpenCL -lGAL
  cubox@cubox:~/cltest$ ./a.out 
  ./a.out: error while loading shared libraries: libOpenCL.so: cannot open shared object file: No such file or directory
  </code></pre>
  
  <p>So I double-check the path of the library:</p>
  
  <pre><code>cubox@cubox:~/cltest$ ls /usr/lib/libOpenCL*   
  /usr/lib/libOpenCL.so
  </code></pre>
  
  <p>And I double-check my <code>LD_LIBRARY_PATH</code> variable:</p>
  
  <pre><code>cubox@cubox:~/cltest$ echo $LD_LIBRARY_PATH
  /usr/lib
  </code></pre>
  
  <p>OK, so clearly the issue is not that it can't find the library, but that there's some kind of incompatibility, and the error is being misleading (I've seen this before). So I try this:</p>
  
  <pre><code>cubox@cubox:~/cltest$ file /usr/lib/libOpenCL.so 
  /usr/lib/libOpenCL.so: ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, not stripped
  </code></pre>
  
  <p>...and compare that with what I just compiled:</p>
  
  <pre><code>cubox@cubox:~/cltest$ file a.out 
  a.out: ELF 32-bit LSB  executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=fcd06f947198f92f43f364874fcef66a6303e7b4, not stripped
  </code></pre>
  
  <p>They look similar, except that one mentions <code>for GNU/Linux 2.6.32</code>. I then remembered that the driver came with some pre-compiled test apps, so I ran one of them:</p>
  
  <pre><code>cubox@cubox:/opt/viv_samples/cl11/fft$ ./fft 
  -bash: ./fft: No such file or directory
  </code></pre>
  
  <p>...and checked its <code>file</code> info:</p>
  
  <pre><code>cubox@cubox:/opt/viv_samples/cl11/fft$ file fft
  fft: ELF 32-bit LSB  executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.31, stripped
  </code></pre>
  
  <p>So one is for <code>GNU/Linux 2.6.32</code>, and the other is for <code>GNU/Linux 2.6.31</code>.</p>
  
  <p>Questions:</p>
  
  <ol>
  <li>Is that why nothing will execute or "find" the libraries?</li>
  <li>If so, what are my options? Can I force them to run somehow?</li>
  <li>Is there another command I can run to learn more about the libraries?</li>
  </ol>
  
  <p>EDIT in response to answer(s):</p>
  
  <p>ldd output:</p>
  
  <pre><code>cubox@cubox:~/cltest$ ldd a.out 
      libOpenCL.so =&gt; not found
      libGAL.so =&gt; not found
      libstdc++.so.6 =&gt; /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x76ea1000)
      libgcc_s.so.1 =&gt; /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x76e80000)
      libc.so.6 =&gt; /lib/arm-linux-gnueabihf/libc.so.6 (0x76d99000)
      libm.so.6 =&gt; /lib/arm-linux-gnueabihf/libm.so.6 (0x76d2c000)
      /lib/ld-linux-armhf.so.3 (0x76f5f000)
  </code></pre>
  
  <p>Executable permissions were already correct (<code>-rwxrwxr-x</code> for mine, <code>-rwxr-xr-x</code> for the fft app).</p>