title: Compiling with gcc and terminal
body: <p>I am attempting to compile C files from <a href="http://cocoadevcentral.com/articles/000081.php" rel="nofollow">http://cocoadevcentral.com/articles/000081.php</a> that I literally copy and pasted, so I do not believe there is any type of syntax error, yet I keep getting errors. I do not know what I am doing wrong. I'm using a text editor called TextWrangler to save my write and save my files. I have Xcode downloaded along with its terminal tools so that shouldn't be an issue either.  </p>
  
  <p>Here are the errors:</p>
  
  <pre><code>testc4.c:4: error: expected identifier or ‘(’ before ‘)’ token
  song.c:5: error: function definition declared ‘typedef’
  song.c:5: error: return type is an incomplete type
  song.c: In function ‘make_song’:
  song.c:6: error: ‘Song’ undeclared (first use in this function)
  song.c:6: error: (Each undeclared identifier is reported only once
  song.c:6: error: for each function it appears in.)
  song.c:6: error: expected ‘;’ before ‘newSong’
  song.c:8: error: ‘newSong’ undeclared (first use in this function)
  song.c:12: warning: ‘return’ with a value, in function returning void
  song.c: At top level:
  song.c:15: error: expected ‘)’ before ‘theSong’
  </code></pre>
  
  <p>Here is the command I'm using to compile my program:</p>
  
  <pre><code>gcc testc4.c song.c -o testc4
  </code></pre>
  
  <p>If needed I can post the files but they are copied right from the tutorial. I named my test file testc4.c instead of whatever it wanted.</p>
  
  <p>Edit: (I figured you'd need to code)</p>
  
  <p>testc4.c file:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include "song.h"
  
  main ()
  {
    Song firstSong  = make_song (210, 2004);
    Song secondSong = make_song (256, 1992);
  
    Song thirdSong  = { 223, 1997 };
    display_song ( thirdSong );
  
    Song fourthSong = { 199, 2003 };
  }
  </code></pre>
  
  <p>song.c file:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include "song.h"
  
  Song make_song (int seconds, int year)
  {
    Song newSong;
  
    newSong.lengthInSeconds = seconds;
    newSong.yearRecorded    = year;
    display_song (newSong);
  
    return newSong;
  }
  
  void display_song (Song theSong)
  {
    printf ("the song is %i seconds long ", theSong.lengthInSeconds);
    printf ("and was made in %i\n", theSong.yearRecorded);
  }
  </code></pre>
  
  <p>song.h file</p>
  
  <pre><code>typedef struct {
    int lengthInSeconds;
    int yearRecorded;
  } Song;
  
  Song  make_song    (int seconds, int year);
  void  display_song (Song theSong);
  </code></pre>
  
  <p>These are straight copied from the site. I typed them out first but when it didn't work I copy and pasted them.</p>