title: How to compile a C project with more than one main function?
body: <p>I am new to C, and now read some textbook and going to apply its examples.</p>
  
  <p>The problem is, whenever I creates a new project and try to put more than one file that contains a main function, the linker (as I thougt0 explains saying:</p>
  
  <pre><code>/home/mohammed/tmp/abcd/main.c:4: multiple definition of `main'
  </code></pre>
  
  <p>(BTW, I used many IDEs, MonoDevelop, QT creator, VS2010, Codebloks, ...)
  I am currently uses QT Creator, It seems to be a very nice IDE.</p>
  
  <p>So, there's not a workaround to solve such problem??</p>
  
  <p><strong><em>EDIT:</em></strong></p>
  
  <p>I am asking because I am in the learning stage, and not do real programming right now.
  I just need a simple way to create programs in C without have to create a separate project per book example.
  At the same time, I don't want to use Gedit/VI + commandline.</p>
  
  <p>So, Isn't there any way such as cleaning the project, then compile the - just - one file that I need to run ???
  BTW, In JAVA we can run a program that cotains more than one main (the IDE give me the choice among them)</p>