title: Compiling Objective-C code on mac terminal
body: <p>I have just started learning Objective-C and I am stuck on a very simple issue. I have written a small program and trying to compile it through Mac terminal by using following command:</p>
  
  <pre><code>clang -framework Foundation main.m -o prog
  </code></pre>
  
  <p>It was working fine until I wrote the following code in main.m</p>
  
  <pre><code>Calculator *calculator = [[Calculator alloc]initWithExpression:expressionArray];
  </code></pre>
  
  <p>It has started giving me following error:</p>
  
  <pre>
  Undefined symbols for architecture x86_64:
    "_OBJC_CLASS_$_Calculator", referenced from:
        objc-class-ref in main-a39d3a.o
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  </pre>
  
  <p>How to tell compiler to import calculator.h file although I have included the following line in main.m:</p>
  
  <pre><code>#import "Calculator.h"
  </code></pre>