title: New to Objective-C. Getting a "may not respond to ' new' warning. " Constructor leading to a segfault
body: <p>So I'm new to Objective-C and I'm following <a href="http://en.wikibooks.org/wiki/Objective-C_Programming/syntax" rel="nofollow">this tutorial</a>. I'm running Linux Mint 14. I've installed gobjc by running <code>sudo apt-get install gobjc</code> and I have gcc already installed as well. I'm trying out their <code>Point</code> example, but I'm running into some weird errors. </p>
  
  <p>Here's my code (pretty much copy and pasted from the website):</p>
  
  <pre><code>#import &lt;objc/Object.h&gt;
  #import &lt;math.h&gt;
  #import &lt;stdio.h&gt;
  
  @interface Point : Object
  {
  @private
     double x;
     double y;
  }
  
  - (id) x: (double) x_value;
  - (double) x;
  - (id) y: (double) y_value;
  - (double) y;
  - (double) magnitude;
  @end
  
  @implementation Point
  
  - (id) x: (double) x_value
  {
     x = x_value;
     return self;
  }
  
  - (double) x
  {
     return x;
  }
  
  - (id) y: (double) y_value
  {
     y = y_value;
     return self;
  }
  
  - (double) y
  {
     return y;
  }
  
  - (double) magnitude
  {
     return sqrt(x*x+y*y);
  }
  
  @end
  
  int main(void)
  {
     Point *point = [Point new];
     [point x:10.0];
     [point y:12.0];
     printf("The distance from the point (%g, %g) to the origin is %g.\n",
        [point x], [point y], [point magnitude]);
  
     return 0;
  }
  </code></pre>
  
  <p>And I'm compiling using <code>gcc Point.m -lobjc -lm</code>. </p>
  
  <p>Here's the error I'm getting:</p>
  
  <pre><code>Point.m: In function ‘main’:
  Point.m:52:4: warning: ‘Point’ may not respond to ‘+new’ [enabled by default]
  Point.m:52:4: warning: (Messages without a matching method signature [enabled by default]
  Point.m:52:4: warning: will be assumed to return ‘id’ and accept [enabled by default]
  Point.m:52:4: warning: ‘...’ as arguments.) [enabled by default]
  </code></pre>
  
  <p>It doesn't seem to be able to find the 'new' method (or maybe alloc/init?). </p>
  
  <p>I've looked up a lot about this problem, but I haven't been able to find much. Everything suggests switching to the newer GNUStep and <code>NSObject</code>, but I'm writing a program for one of my CS classes, and I think I have to stick to <code>objc/Object.h</code>. </p>
  
  <p>At the beginning of the year, we were given a pre-configured Ubuntu image to use in VirtualBox that we could program on, and this program works fine on that. I'm not sure what is on there that makes it work. Could it be that Linux Mint 14 doesn't support this old of a version of Objective-C? </p>
  
  <p>Any help/feedback is appreciated! </p>