title: How to link using GCC without -l nor hardcoding path for a library that does not follow the libNAME.so naming convention?
body: <p>I have a shared library that I wish to link an executable against using GCC. The shared library has a nonstandard name not of the form libNAME.so, so I can not use the usual -l option. (It happens to also be a Python extension, and so has no 'lib' prefix.)</p>
  
  <p>I am able to pass the path to the library file directly to the link command line, but this causes the library path to be hardcoded into the executable.</p>
  
  <p>For example:</p>
  
  <pre><code>g++ -o build/bin/myapp build/bin/_mylib.so
  </code></pre>
  
  <p>Is there a way to link to this library without causing the path to be hardcoded into the executable?</p>