title: Why is gcc failing with 'unrecognized command line option "-L/lusr/opt/mpfr-2.4.2/lib"'?
body: <p>My sysadmin recently installed a new version of GCC, in /lusr/opt/gcc-4.4.3. I tested it as follows:</p>
  
  <pre><code>mike@canon:~$ cat test.c
  int main(){
    return 0;
  }
  mike@canon:~$ gcc test.c
  /lusr/opt/gcc-4.4.3/libexec/gcc/i686-pc-linux-gnu/4.4.3/cc1: error while loading shared libraries: libmpfr.so.1: cannot open shared object file: No such file or directory
  </code></pre>
  
  <p>After informing my sysadmin about this, he said to add <code>/lusr/opt/mpfr-2.4.2/lib:/lusr/opt/gmp-4.3.2/lib</code> to my <code>LD_LIBRARY_PATH</code>. After doing this, I get the following error:</p>
  
  <pre><code>mike@canon:~$ gcc test.c
  cc1: error: unrecognized command line option "-L/lusr/opt/mpfr-2.4.2/lib"
  </code></pre>
  
  <p>First, my sysadmin wasn't entirely sure this was the best workaround(though he did say it worked for him...), so is there a better solution?</p>
  
  <p>Second, why am I getting a linker error from <code>cc</code>, and how can I fix it?</p>
  
  <p>Some information which may be helpful:</p>
  
  <pre><code>mike@canon:~$ env | grep mpfr
  OLDPWD=/lusr/opt/mpfr-2.4.2/lib
  LD_LIBRARY_PATH=/lusr/opt/mpfr-2.4.2/lib:/lusr/opt/gmp-4.3.2/lib:
  
  mike@canon:~$ echo $LDFLAGS
  
  (the above is a blank line)
  </code></pre>