title: undefined reference to __isoc99_sscanf
body: <p>I have a static C library <code>libex.a</code> that uses <code>sscanf</code>. Library was compiled using <code>-std=c99</code></p>
  
  <p>I want to use the library function in some C++ code that I am compiling using <code>-std=c++11</code>, but I get the following error:</p>
  
  <pre><code>lib/libex.a(srcfile.o): In function `my_function':
  /srcpath/srcfile.c:215: undefined reference to `__isoc99_sscanf'
  </code></pre>
  
  <p>After poking around a bit, I have discovered that <code>sscanf</code> has issues with versions due to a backwards compatibility hack, hence the redirect to <code>__isoc99_sscanf</code>, so I suspect that is somehow the source of the problem. However, I checked my version of <code>glibc</code> and it looks recent enough that the solution suggested elsewhere (update your copy of <code>glibc</code> to at least 2.7) isn't helpful.</p>
  
  <pre><code>$ ldd --version
  ldd (Ubuntu EGLIBC 2.19-0ubuntu6.6) 2.19
  </code></pre>
  
  <p>Any suggestions?</p>
  
  <p>Of course, let me know if there's any additional information that would be relevant.</p>
  
  <p>Thanks!</p>
  
  <p>UPDATE: If I compile <code>libex.a</code> with <code>-D_GNU_SOURCE</code> the error message is changed to <code>undefined reference to sscanf</code>. Not sure if that will help figure out what's going wrong.</p>