title: Python extension: symbol(s) not found for architecture x86_64 error
body: <p>I want to write a python extension in c. I work on Mac, I took a code from <a href="http://en.wikibooks.org/wiki/Python_Programming/Extending_with_C" rel="nofollow">here</a>:</p>
  
  <pre><code>#include &lt;Python.h&gt;
  
  static PyObject* say_hello(PyObject* self, PyObject* args)
  {
      const char* name;
  
      if (!PyArg_ParseTuple(args, "s", &amp;name))
          return NULL;
  
      printf("Hello %s!\n", name);
  
      Py_RETURN_NONE;
  }
  
  static PyMethodDef HelloMethods[] =
  {
       {"say_hello", say_hello, METH_VARARGS, "Greet somebody."},
       {NULL, NULL, 0, NULL}
  };
  
  PyMODINIT_FUNC
  
  inithello(void)
  {
       (void) Py_InitModule("hello", HelloMethods);
  }
  </code></pre>
  
  <p>I compile it:</p>
  
  <pre><code>gcc -c -o py_module.o py_module.c -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/
  gcc -o py_module py_module.o -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/ -lm
  </code></pre>
  
  <p>But I get this error:</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
    "_PyArg_ParseTuple", referenced from:
        _say_hello in py_module.o
    "_Py_InitModule4_64", referenced from:
        _inithello in py_module.o
    "__Py_NoneStruct", referenced from:
        _say_hello in py_module.o
    "_main", referenced from:
        start in crt1.10.6.o
  ld: symbol(s) not found for architecture x86_64
  collect2: ld returned 1 exit status
  make: *** [py_module] Error 1
  </code></pre>
  
  <p>How comes python doesn't support <code>X86_64</code> architecture? </p>