title: C++ Find and remove references to little-used library
body: <p>I'm modifying a large collection of legacy C++ code which has a few dependencies on the old commoncpp library.  We want to replace commoncpp with something more modern (e.g. Boost).</p>
  
  <p>First I need to find all the places commoncpp-provided functions and methods are used.  The obvious brute force methods take too much time (especially for "lazy" programmers like me who believe computers should do the tedious work :-).</p>
  
  <p>I'm looking for ideas on how to speed up the process.  </p>
  
  <p>If <code>ld</code> had a flag that said "continue looking for external references and spit out any missing references" that might do the everything needed.  </p>
  
  <p>Our code is spread over many directories, with hierarchal, recursive Makefiles, if that makes a difference to a proposed solution.</p>
  
  <p>Environment is FreeBSD with Gnu compiler chain.</p>
  
  <p>I tagged this with C as well, since most solutions which would solve this kind of problem for C should solve it for C++ also.</p>
  
  <p>(guess you can't format comments)</p>
  
  <p>Using <code>--cxref</code> in my build, and then this pipeline:</p>
  
  <pre><code>% egrep 'ccgnu2|ccext2' output.txt | sort | uniq
  </code></pre>
  
  <p>Gets me this:</p>
  
  <pre><code>on-virtual thunk to ost::ttystream::~ttystream() ../../lib/libccext2.so
  non-virtual thunk to ost::unixstream::~unixstream() ../../lib/libccext2.so
  ost::CRC16Digest::getSize() ../../lib/libccext2.so
  ost::CRC16Digest::initDigest() ../../lib/libccext2.so
  ost::CRC16Digest::~CRC16Digest() ../../lib/libccext2.so
  ost::CRC32Digest::getSize() ../../lib/libccext2.so
  </code></pre>
  
  <p>I wonder if I can so something useful with the above to get what I need.</p>