title: Compiling a dynamic link library on Ubuntu and getting unrecognised debug output level
body: <p>I am trying to compile a DLL (.so) file on Ubuntu using GCC. The library has one dependency which is a static library which I was able to compile with GCC. I am using the following command line and producing the following error:</p>
  
  <pre><code>gcc -shared -Bstatic -gpclib.a -fPIC gpcdll.h gpcdll.c
  </code></pre>
  
  <p>Output:</p>
  
  <blockquote>
    <p>cc1: error: unrecognised debug output level ‘pclib.a’</p>
    
    <p>cc1: error: unrecognised debug output level ‘pclib.a’</p>
  </blockquote>
  
  <p>I have tried googling this error with no success.</p>
  
  <p>Update:</p>
  
  <p>I have attempted running and the following based on recommendation:</p>
  
  <pre><code>gcc -shared -Bstatic -lgpclib.a -fPIC gpcdll.h gpcdll.c
  </code></pre>
  
  <p>Result:</p>
  
  <blockquote>
    <p>gpcdll.c:19:17: fatal error: gpc.h: No such file or directory
     #include "gpc.h"
                     ^
    This make sense to me because my static library is called gpclib.a and not lgpclib.a</p>
  </blockquote>
  
  <p>Update #3: I attempted to run with -g to get more debugging information but got nothing more than what was produced prior.</p>
  
  <p>Update #4: gcc -shared -lgpc -gpclib.a -fPIC gpcdll.h gpcdll.c produces the same error message.</p>
  
  <p>Update #5: I tried:</p>
  
  <pre><code>gcc -shared -Wl,-Bstatic -L.\ -lgpclib.a -fPIC gpcdll.h gpcdll.c
  </code></pre>
  
  <p>Which is supposed to specify the current working directory as the search path but it still saying:</p>
  
  <blockquote>
    <p>gpcdll.c:19:17: fatal error: gpc.h: No such file or directory</p>
  </blockquote>
  
  <p>Update #6: So I finally got frustrated enough and removed all the code from the static library (gpc.h &amp; gpc.c) and put them in the same directory as the gpcdll.h gpcdll.c and was able to compile but I feel like you should be able to link a static library that contains that code and it must be something simple that I am missing.</p>