using Anaconda, Python 3.4 and Win7 64bit, i can't get this running:
C Code:
int addInts(int a, int b)
{
return a+b;
}
PYX file:
cdef extern from "square.cpp":
int addInts(int, int)
def pAddInts(int a, int b):
return addInts(a, b)
and testfile:
res = callCpp.pAddInts(3, 4)
error message:
Traceback (most recent call last):
File "testScript.py", line 9, in <module>
res = callCpp.pAddInts(a, b)
File "callCpp.pyx", line 16, in callCpp.pAddInts (callCpp.cpp:952)
def pAddInts(int a, int b):
TypeError: __int__ returned non-int (type int)
No problems @all with double and double*, but ints don't work.. Whats the problem here? Thanks!