[Python-bugs-list] [ python-Bugs-762614 ] problem building c extension with minGW on Windows

SourceForge.net noreply@sourceforge.net
Mon, 30 Jun 2003 09:08:10 -0700


Bugs item #762614, was opened at 2003-06-29 05:07
Message generated for change (Comment added) made by gvanrossum
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: Closed
>Resolution: Rejected
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);
    */

};

----------------------------------------------------------------------

>Comment By: Guido van Rossum (gvanrossum)
Date: 2003-06-30 12:08

Message:
Logged In: YES 
user_id=6380

This must be a problem in minGW, not in Python. Please go
ask the minGW developers for help.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=762614&group_id=5470