title: Make /usr/local/lib a default library search path for ld on mac os x?
body: <p>I have XCode installed, but for some reason, /usr/local/lib is not amongst the default library search paths:</p>
  
  <pre><code>gcc -Xlinker -v
  </code></pre>
  
  <p>gives me:</p>
  
  <pre><code>@(#)PROGRAM:ld  PROJECT:ld64-224.1
  configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 armv6m armv7m armv7em
  Library search paths:
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib
  Framework search paths:
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/
  </code></pre>
  
  <p>This is unfortunate since <code>/usr/local/lib</code> is a fairly canonical location for installed libraries and and there is no <code>/etc/ld.so.conf</code>+<code>ldconfig</code> on <code>mac os x</code> to modify the default library search paths. So without using <code>-L/usr/local/lib</code> this results in a linker error. Is there any other, non-runtime option than setting the environment variable <code>DYLD_LIBRARY_PATH</code>?</p>
  
  <p><strong>EDIT</strong>: Setting the <code>DYLD_LIBRARY_PATH</code> env variable did nothing for me. I had to set the <code>LIBRARY_PATH</code> env variable instead to be able to link libraries installed under <code>/usr/local/lib</code> with <code>gcc</code>.</p>
  
  <p>Was there an option about this when installing <code>XCode</code>? (it's a work computer, haven't installed it myself)</p>