title: Code::Blocks - how to compile multiple source files
body: <p>I'm trying to compile a program with multiple source files - two CPP files and a header file, with code::blocks. As an example, I have created the following three files (an example program created by someone else on another forum):</p>
  
  <p>main.cpp:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include "other.h"
  
  int main (void)
  {
      printf("%d\n", getfavoritenumber());
  
      return 0;
  }
  </code></pre>
  
  <p>other.cpp</p>
  
  <pre><code>#include "other.h"
  
  int getfavoritenumber(void)
  {
      return 3;
  }
  </code></pre>
  
  <p>other.h</p>
  
  <pre><code>#ifndef _OTHER_H_
  #define _OTHER_H_
  
  int getfavoritenumber(void);
  
  #endif
  </code></pre>
  
  <p>Despite the fact that these three files <em>should</em> link to each other, I receive the error "Linking stage skipped (build target has no object files to link)" when I try to build the project.</p>
  
  <p>What am I doing wrong? Trying to compile the individual files presents the error "That file isn't assigned to any target".</p>