title: Undefined Symbols for architecture x86_64 Xcode Mac
body: <p>I need some help.
  Recently I've tried to learn some programming, and had a couple of problems, but they've all been solved.
  except for this one.
  I know it has been answered many times, but I have never found a solution for my specific case.
  I am using Xcode V. 4.5.2
  Here is the program:</p>
  
  <pre><code>int add(int x, int y);
  
  int main()
  
      using namespace std;
      cout &lt;&lt; "3 + 4 + 5 = " &lt;&lt; add(3, 4) &lt;&lt; endl;
      return 0;
  }
  
  int add(int x, int y, int z)
  
      return x + y + z;
  }
  </code></pre>
  
  <p>It gives me this error:</p>
  
  <blockquote>
    <p>Undefined symbols for architecture x86_64:   "add(int, int)",
    referenced from:
          _main in main.o
         (maybe you meant: __Z3addiii) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code
    1 (use -v to see invocation)</p>
  </blockquote>
  
  <p>I have no idea what to do.</p>
  
  <p>I have been following this tutorial:</p>
  
  <p><a href="http://www.learncpp.com/cpp-tutorial/17-forward-declarations/" rel="nofollow">http://www.learncpp.com/cpp-tutorial/17-forward-declarations/</a></p>
  
  <p>the Fifth Program under Quiz is this one.</p>
  
  <p>Thanks
  Lemonizer</p>