title: Python extensions for Win64 via GCC
body: <p>Has anyone had any luck with compiling 64-bit Python extension modules for Windows using mingw64? </p>
  
  <p>I have successfully compiled the extension in question with VS2008 for this platform. I've also compiled it with mingw32 (with a 32-bit python). I would prefer both builds to use GCC.</p>
  
  <p>I've installed the mingw64-x86_64-w64 GCC 4.5.1 set of tools using Cygwin and convinced Python to use them. However, linking to python itself failed.</p>
  
  <p>So I picked up pexports 0.44, used it to dump out a <code>python26.def</code> file and create <code>libpython26.a</code>. </p>
  
  <p>Now, as in <a href="https://stackoverflow.com/questions/2842469/python-undefined-reference-to-imp-py-initmodule4">this question</a>, the only link error I'm getting from Python is about <code>__imp_py_InitModule4</code>. Browsing through the def file, I see a <code>Py_InitModule4_64</code> symbol. </p>
  
  <p>Any ideas?</p>