This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: problem building c extension with minGW on Windows
Type: Stage:
Components: Extension Modules Versions: Python 2.3
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: fumingw, gvanrossum
Priority: normal Keywords:

Created on 2003-06-29 09:07 by fumingw, last changed 2022-04-10 16:09 by admin. This issue is now closed.

Messages (2)
msg16659 - (view) Author: Fuming Wang (fumingw) Date: 2003-06-29 09:07
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);
    */

};
msg16660 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2003-06-30 16:08
Logged In: YES 
user_id=6380

This must be a problem in minGW, not in Python. Please go
ask the minGW developers for help.
History
Date User Action Args
2022-04-10 16:09:29adminsetgithub: 38732
2003-06-29 09:07:08fumingwcreate