title: g++ vs gcc, linking problem with a static library (.a)
body: <p>I'm trying to link a static library (.a) file with a .o file which supposedly uses the symbols from the library. However, when using gcc - the normal linker error comes up, regardless of using the .a file as </p>
  
  <p>gcc -L. a.c staticlib.a </p>
  
  <p>However, the same command works with g++ flawlessly. </p>
  
  <p>Why is this happening ?</p>
  
  <p>I can see that the .c file is totally legal c ( and hence c++ ), but then why isn't gcc able to detect symbols in the the library ?</p>
  
  <p>Tried finding the symbols in the library using objdump, was able to find closely resembling symbols, but not exact ones. e.g:</p>
  
  <p>Got 
  00000000000000b0 g     F .text  000000000000004e _*Z15PhttsFn_InitTTSPh*
  for the symbol *PhttsFn_InitTTS*</p>
  
  <p>Can someone please explain this phenomenon ? I've also checked the architecture the library file was compiled for, and it's the same as my architecture.</p>
  
  <p>Thanks!</p>