[Python-bugs-list] [ python-Bugs-762614 ] problem building c extension with minGW on Windows
SourceForge.net
noreply@sourceforge.net
Sun, 29 Jun 2003 02:07:08 -0700
Bugs item #762614, was opened at 2003-06-29 17:07
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=762614&group_id=5470
Category: Extension Modules
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Fuming Wang (fumingw)
Assigned to: Nobody/Anonymous (nobody)
Summary: problem building c extension with minGW on Windows
Initial Comment:
I am having problems building C extension on Python
2.3b1 on Windows 2000 with latest minGW. The culprit
seems to be calling of Py_None. Here is a test module,
which builds happily on python 2.2.3.
Here is build options:
gcc -mno-cygwin -mdll -O -Wall
-Id:\fuming\lib\python\include -c spam.c -o spam.o
dllwrap -mno-cygwin -mdll -static --dllname spam.pyd
--driver-name gcc --def spam.def -o spam.pyd s
pam.o -s --entry _DllMain@12 --target=i386-mingw32
-Ld:\fuming\lib\python\libs -lpython23
Here is the error message I get on Python 2.3b1:
spam.o(.text+0x60):spam.c: undefined reference to
`_imp___Py_NoneStruct'
spam.o(.text+0x68):spam.c: undefined reference to
`_imp___Py_NoneStruct'
dllwrap: gcc exited with status 1
Here is the source code:
/* c function */
static PyObject *
spam_system(PyObject *self, PyObject *input_str)
{
char *local_string;
int length;
if (!PyArg_ParseTuple(input_str, "s#",
&local_string, &length)) {
return NULL;
}
printf("%s\n", local_string);
printf("number of letters = %d\n", length);
Py_INCREF(Py_None);
return Py_None;
/*
return Py_BuildValue("i", length);
*/
};
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=762614&group_id=5470