title: gcc compile errors in an basic example objc program
body: <p>Hey all, I'm new to programming and going through an objective-c book to learn the language and programing fundamentals. I've looked through the code repeatedly, went back to the book's example, and attempted to understand the gcc comple errors. Here's my code:</p>
  
  <pre><code>#import &lt;stdio.h&gt;
  #import &lt;objc/Object.h&gt;
  
  @interface Point: Object
      {
          int xaxis;
          int yaxis;
      }
  
      -(void) print;
      -(void) setx:   (int)x;
      -(void) sety:   (int)y;
  
  @end
  
  @implementation Point;
  
      -(void) print
          {
              printf("(%i,%i)", xaxis, yaxis);
          }
  
      -(void) setx:   (int) x
          {
              xaxis = x;
          }
  
      -(void) sety:   (int) y
          {
              yaxis = y;
          }
  @end
  
  int main (int argc, char *argv[])
      {
          Point *myPoint;
  
          myPoint = [Point alloc];
  
          myPoint = [myPoint init];
  
          [myPoint setx: 4];
          [myPoint sety: 5];
  
          printf("The coordinates are: ");
              [myPoint print];
          printf("\n");
  
          [myPoint free];
  
          return 0;
  
      }
  </code></pre>
  
  <p>Then the compile errors from gcc look like this:</p>
  
  <pre><code>urban:Desktop alex$ gcc point.m -o point -l objc
  point.m: In function ‘main’:
  point.m:38: warning: ‘Point’ may not respond to ‘+alloc’
  point.m:38: warning: (Messages without a matching method signature
  point.m:38: warning: will be assumed to return ‘id’ and accept
  point.m:38: warning: ‘...’ as arguments.)
  point.m:40: error: ‘mypoint’ undeclared (first use in this function)
  point.m:40: error: (Each undeclared identifier is reported only once
  point.m:40: error: for each function it appears in.)
  point.m:49: warning: ‘Point’ may not respond to ‘-free’
  </code></pre>
  
  <p>Where am I going wrong?</p>
  
  <p>btw I'm going through "Programming in Objective-C" by Stephen Kochan if you wanted to know.</p>