title: Cython: "Cannot convert Python object" error
body: <p>I'm trying to get a test project working that calls a C function, with an array parameter, from Python:</p>
  
  <p><strong>test.cpp</strong>:</p>
  
  <pre><code>void testFn(int arr[]);
  
  void testFn(int arr[])
  {
      arr[0] = 1;
      arr[1] = 2;
  } 
  </code></pre>
  
  <p><strong>caller.pyx</strong>:</p>
  
  <pre><code>import ctypes
  
  cdef extern from "test.cpp":
      void testFn(int arr[])
  
  def myTest():
      a = [0, 0]
      arr = a.ctypes.data_as(ctypes.POINTER(ctypes.c_integer))
      testFn(arr)
      print(arr)
  </code></pre>
  
  <p><strong>setup.caller.py</strong>:</p>
  
  <pre><code>from distutils.core import setup
  from distutils.extension import Extension
  from Cython.Distutils import build_ext
  
  sourcefiles = ['caller.pyx']
  ext_modules = [Extension("caller", sourcefiles)]
  
  setup(
      name = 'test app',
      cmdclass = {'build_ext': build_ext},
      ext_modules = ext_modules
  )
  </code></pre>
  
  <p>But when I try to build the project I get an error:</p>
  
  <pre><code>$ python setup.caller.py build_ext --inplace
  running build_ext
  cythoning caller.pyx to caller.c
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
  def myTest():
      a = [0, 0]
      arr = a.ctypes.data_as(ctypes.POINTER(ctypes.c_integer))
      testFn(arr)
            ^
  ------------------------------------------------------------
  
  caller.pyx:13:11: Cannot convert Python object to 'int *'
  </code></pre>