1

I don't manage to build libpythonX.a.

dlltool --dllname "python27.dll" --def "python27.def" --output-lib libpython27.a

I get the following error dlltool.exe: Syntax error in def file python27.def:0

I have been following the steps on http://sebsauvage.net/python/mingw.html, section 2.

I'm using MinGW32, python 32 bit.

Anyone have any ideas as to what I am missing?

1 Answers1

-1

python27.def is generated by pexports.exe. And the first line of python27.def is "LIBRARY python27.dll". dlltool does not use this line. So you must delete that line.

  • Seems like comment more, than answer. – Divyang Desai Nov 16 '16 at 08:03
  • Not only is it more comment than answer, it is just plain incorrect; dlltool **does** use the `LIBRARY foo.dll` line, but it does seem to consider some patterns for `foo.dll` to be invalid ... for me `LIBRARY python27.dll` is not reported as a syntax error, but `LIBRARY libstdc++-6.dll` is). If you are seeing this syntax error, you should file a `GNU binutils` bug report, citing the failing library name pattern. – Keith Marshall Dec 11 '16 at 11:43