title: What is GCC behavior for specifying libraries with absolute paths
body: <p>GCC (linking) was barfing that it could not find a library when specified with an absolute path.  Note the reason I want this is I have a build system that keeps all libraries resolved by absolute path so it can keep an ordered set of unique entries.</p>
  
  <pre><code>g++ (...) -l/path/to/library.so
  </code></pre>
  
  <p>I saw a bug report where some people thought it was a bug, and others thought the fact it ever worked was a bug, and it was fixed.</p>
  
  <p>There was some discussion that one had to precede the path with a ':'</p>
  
  <p>Anyway didn't make it work.</p>
  
  <p>So to test in the build system I put code in to truncate the absolute library path if it's "prefix" matched any of the library paths specified to GCC and truncate the absolute library path.</p>
  
  <pre><code>g++ (...) -L/path/to -llibrary.so
  </code></pre>
  
  <p>This worked.<br>
  I also tried this.</p>
  
  <pre><code>g++ (...) -L/path/to -l/path/to/library.so
  </code></pre>
  
  <p>and it worked. 9 (though investigating .. looks like this was an error in the build script )</p>
  
  <p>It seems possibly if any of the search paths specified for GCC are a "prefix" to a library specified with an absolute path it finds the library.  I would also assume it takes the first hit in the ordered list of library paths supplied.</p>
  
  <p>So my questions.</p>
  
  <ul>
  <li>Is this supported behavior?</li>
  <li>Is it better in this to truncate the absolute library path in the build script or pass in the absolute path.</li>
  </ul>
  
  <p>I notices some related issues brought up here:</p>
  
  <p><a href="https://stackoverflow.com/questions/207069/how-to-link-using-gcc-without-l-nor-hardcoding-path-for-a-library-that-does-not?rq=1">How to link using GCC without -l nor hardcoding path for a library that does not follow the libNAME.so naming convention?</a></p>
  
  <p>This indicates a "non searched" full path is "burned in" to an executable thus overriding any runtime library path when it is executed?  Is this correct ?  If so it means specifying the library with the full path on the command line is not appropriate.  On deployment the built app and associated libraries would be installed in standard searchable locations.</p>