Creating a 64-bit libpython27.a using cygwin, dlltool

I am trying to build a DLL extension for python on a 64-bit Win7 machine using cygwin (since cygwin only works as a 32-bit process, this is actually cross-compiling).

I created libpython27.a myself from python27.dll using dlltool (as explained, for example, here ), but the assembly failed during the linker phase saying
skipping incompatible c:\Python27\libs/libpython27.a when searching for -lpython27
This is exactly the error reported here (where the guy switched to the MSVC compiler ...) .

Additional information:
- Active Python 2.7.2, win64, x64
- the latest version of cygwin using the compiler / usr / bin / x 86_64-w64-mingw32-g ++. Exe

Does anyone know if this is supported?
Is there a way to use the dlltool that I skipped here?

(I found a usage guide heredlltool --as-flags=--64 -m i386:x86-64 -k -l libpython27.a -d python.def
but at the same time I got an "invalid bfd target"error from dlltool)

Thank!

Update . I believe this can be done because Enthought python contains such a file. I would like to create one for the more common distributions that do not contain it.

+5
source share
2 answers

, 32- dlltool. , C:\MinGW\bin C:\MinGW64\bin. 64- :

C:\MinGW64\bin\dlltool -v --dllname python27.dll --def python27.def --output-lib libpython27.a
+1

, , , , - :

MinGW-w64. , MinGW Python (, libpython27.a) AMD64 Python. . dlltool. MinGW-w64 , "-" , 64- , . TDM-GCC. mingw MSVC; , , , g++ gfortran. , MinGW-w64 .

0

All Articles