[PyQt] Build failed with Python 3.7.0 & mingw32 5.3

黄其泽 hgoldfish at gmail.com
Mon Oct 15 09:21:38 BST 2018


I try to build PyQt with mingw32 5.3 which bundled in Qt 5.11.2, but
failed. The error messages show that the .pyd can not link to libpython37.a

I change some code in `configure.py`:

if limited and False:  # add `and False` to use full dll
    pylib_lib = 'python%d%s' % (py_major, debug_suffix)
else:
    pylib_lib = 'python%d%d%s' % (py_major, py_minor, debug_suffix)

and

if not self.static:
    pro_lines.extend(['win32 {',
            '    LIBS += ' + self.get_pylib_link_arguments(name=True),  #
change `name=False` to `name=True`
            '}'])

After these changes, I built PyQt successfully. This bug maybe caused by
three rease:
1. The Python 3.7.0 contains no `libpython3.a` (the limited api),
2. Mingw32 does not link to libpython37.a automatically.
3. the `--link-full-dll` option does not works.

Plus, `QMAKE_CXXFLAGS+="-D_hypot=hypot"` should be append to `configure.py`
command line for successful building. But I do not known why:

python configure.py QMAKE_CXXFLAGS+="-D_hypot=hypot"

-- 
Python及Qt相关Blog:http://hgoldfish.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20181015/4c283191/attachment.html>


More information about the PyQt mailing list