title: "error: unknown type name 'PyObject'" when using C extension on python
body: <p>I was trying to write a selection sort C program for an array that could be run using python commands.  This is what I have in my C file:</p>
  <pre><code>#include &lt;stdio.h&gt;
  
  int selectionsort(array[], N){
      int i, j, min_element;
      
      for (i = 0; i &lt; N-1; i++) {
          min_element = i;
          for (j = i+1; j &lt; N; j++)
          if (array[j] &lt; array[min_element])
          min_element = j;
          int temp = array[min_element];
          array[min_element] = array[i];
          array[i] = temp;
      }
      
      printf(&quot;Sorted array: &quot;);
      printf(&quot;[&quot;);
      for (i = 0; i &lt; N; i++){
          printf(&quot;%d&quot;, array[i]);
          if (i != N-1){
              printf(&quot;, &quot;);
          }
      }
      printf(&quot;]&quot;);
      return 0;
  }
  
  static PyObject* selectSort(PyObject* self, PyObject* args)
  {
      int array[20000];
      int N = sizeof(array)/sizeof(array[0]);
      if(!PyArg_ParseTuple(args, &quot;i&quot;, &amp;array, &amp;N))
          return NULL;
      return Py_BuildValue(&quot;i&quot;, selectionsort(array, N));
  }
  
  static PyMethodDef myMethods[] = {
      { &quot;selectSort&quot;, selectSort, METH_VARARGS, &quot;selectSort&quot; },
      { NULL, NULL, 0, NULL }
  };
  
  static struct PyModuleDef myModule = {
      PyModuleDef_HEAD_INIT,
      &quot;myModule&quot;,
      &quot;Test Module&quot;,
      -1,
      myMethods
  };
  
  PyMODINIT_FUNC PyInit_myModule(void)
  {
      return PyModule_Create(&amp;myModule);
  }
  </code></pre>
  <p>This is what I have in my setup.py file:</p>
  <pre><code>from distutils.core import setup, Extension
  setup(name = 'myModule', version = '1.0',  \
     ext_modules = [Extension('myModule', ['selectSort.c'])])
  </code></pre>
  <p>However, when I was trying to build using terminal command line, it gave me 12 errors, an example will be:
  <code>selectSort.c:28:8: error: unknown type name 'PyObject' static PyObject* selectSort(PyObject* self, PyObject* args)</code></p>
  <p>How come it does not know what is PyObject? Anyone has any ideas on how to solve it?
  Thank you so much.</p>