[Distutils] Help with Disutils / MinGW

David Cournapeau cournape at gmail.com
Sun Mar 28 09:20:02 CEST 2010


On Sat, Mar 27, 2010 at 10:34 PM, James Reynolds <eire1130 at gmail.com> wrote:
> Hello All,
> I'm trying to write my first extension module, and I am getting the
> following error in my command prompt and I was hoping you all could help me.
> I have taken the following steps already:

Are you trying to build a C extension or something importable by ctypes ?
>
> I am running Windows 7 64 bit version, I have installed the Python 3.1.2 64
> bit interpreter. I have the MinGW32 and the one referenced above as well.

Mingw is useless, since you want to build a 64 bits extension. You
have to use mingw-w64.


>> erence to `_imp__Py_BuildValue'
>>
>> build\temp.win-amd64-3.1\Release\finance.o:finance.c:(.text+0x74):
>> undefined ref
>>
>> erence to `Py_Module_Create'

This is exactly the problem I refered to in the issue 4709 you
mentioned. Since the issue is stalled ATM, you have to define the
necessary macro by yourself in distutils (using define_macros in
setup.py).

Note that mingw-w64 is totally unsupported by python ATM, and you will
have a hard time making it work. By far the easiest solution to build
64 bits extensions on windows is to use MS compilers (which are
available for free).

cheers,

David


More information about the Distutils-SIG mailing list