title: C-library not linking using gcc/g++
body: <p>I have a c-library which I use in gcc. The library has the extension .lib but is always linked as a static library. If i write a program which uses the library as c-code, everything as a-ok. If I however rename the file to .cpp (doing simple stuff that works in both c/c++) I get undefined reference. These are simple small programs I write for testing purposes so no fancy stuff. I compile using:</p>
  
  <pre><code>gcc -g -Wall -I &lt;path to custom headers&gt; -o program main.c customlibrary.lib -lm -lpthread
  </code></pre>
  
  <p>The above works like a charm. However:</p>
  
  <pre><code>g++ -g -Wall -I &lt;path to custom headers&gt; -o program main.cpp customlibrary.lib -lm -lpthread
  </code></pre>
  
  <p>or</p>
  
  <pre><code>gcc -g -Wall -I &lt;path to custom headers&gt; -o program main.cpp customlibrary.lib -lm -lpthread -lstdc++
  </code></pre>
  
  <p>results in undefined reference to any function in customlibrary.lib. I tried creating a symbolic link named customlibrary.a but no luck.</p>
  
  <p>Why won't g++ find recognize my library. Unfortunately I have no access to the source code of the libraries but linking a c-lib to c++ should not be a problem right? </p>