seeking an example on C extension works in python 3.1.x or above

2011-07-26 Thread llwaeva
Hello, I have been searching the example on C extension that works in python 3.1.x ror above for long time. I tried the simple example given in python document or enclosed in python's src (PC folder), doesn't work, undefined reference to `_imp___Py_NoneStruct' and undefined reference to `_imp

problem in compiling C API in mingw

2011-07-26 Thread llwaeva
Hi all again, I wonder if so far only Python 2.5.x support c extension. I try the MSVC 2010 and 2008, also try mingw (gcc 4.x.x) and swig. But even I try the simplest example, it said example_wrap.o:example_wrap.c:(.text+0x10ac): undefined reference to `_imp__PyObject_Free' example_wrap.o:ex

problem in compiling the module in VC2010

2011-07-20 Thread llwaeva
Hi all, I am compiling the example with MCVS2010 #include "Python.h" static PyObject * ex_foo(PyObject *self, PyObject *args) { printf("Hello, world\n"); Py_INCREF(Py_None); return Py_None; } static PyMethodDef example_methods[] = { {"foo", ex_foo, METH_VARARGS, "foo() doc stri