title: How can I force GCC to compile functions that are not used?
body: <p>I am splitting off some of the code in my project into a separate library to be reused in another application.  This new library has various functions <em>defined</em> but not <em>implemented</em>, and both my current project and the other application will implement their own versions of these functions.</p>
  
  <p>I implemented these functions in my original project, but they are not called anywhere inside it. They are only called by this new library.  As a result, the compiler optimizes them away, and I get linking failures.  When I add a dummy call to these functions, the linking failures disappear.</p>
  
  <p>Is there any way to tell GCC to compile these functions even if they're not being called?</p>
  
  <p>I am compiling with gcc 4.2.2 using <code>-O2</code> on SuSE linux (x86-64_linux_2.6.5_ImageSLES9SP3-3).  </p>