title: ELF: linking: Why do I get undefined references in .so files
body: <p>I'm trying to build a program against wxWidgets, and I get a linker error. I'd like to really understand what it means. The error is:</p>
  
  <pre><code>/usr/lib/libwx_baseu-2.8.so: undefined reference to `std::ctype&lt;char&gt;::_M_widen_init() const@GLIBCXX_3.4.11'
  </code></pre>
  
  <p>What I don't understand is why the error is at <code>libwx_baseu-2.8.so</code>. I thought that <code>.so</code> files had all its symbols resolved, contrary to <code>.o</code> files that still need linking.</p>
  
  <p>When I <code>ldd</code> the <code>.so</code>, I get can resolve all its linked libraries, so there is no problem there:</p>
  
  <pre><code>$ ldd /usr/lib/libwx_baseu-2.8.so
   linux-gate.so.1 =&gt;  (0x00476000)
   libz.so.1 =&gt; /lib/libz.so.1 (0x00d9c000)
   libdl.so.2 =&gt; /lib/libdl.so.2 (0x002a8000)
   libm.so.6 =&gt; /lib/libm.so.6 (0x00759000)
   libstdc++.so.6 =&gt; /usr/lib/libstdc++.so.6 (0x002ad000)
   libgcc_s.so.1 =&gt; /lib/libgcc_s.so.1 (0x0068d000)
   libpthread.so.0 =&gt; /lib/libpthread.so.0 (0x006f0000)
   libc.so.6 =&gt; /lib/libc.so.6 (0x00477000)
   /lib/ld-linux.so.2 (0x007f6000)
  </code></pre>
  
  <p>Does it means that the <code>.so</code> file was not compiled correctly (in that case, it's a bug in my distribution package) or does it means that there are missing libraries on the linker command line for my particular program?</p>
  
  <p>Additionally, do you know how I can get a list on undefined symbols in an ELF file. I tried <code>readelf -s</code> but I can't find the missing symbol.</p>
  
  <p>Thank you.</p>
  
  <p>Mildred</p>