[PyQt] Expat bug in pyqtdeploy/metadata/python_metadata.py

Patrick Stinson patrickkidd at gmail.com
Sun Nov 4 19:53:20 GMT 2018


It looks like "expat/loadlibrary.c” needs to be added to the expat library sources in python_metadata.py for windows. I edited it like so:

    'pyexpat':
        ExtensionModule(internal=True,
                source=('expat/xmlparse.c', 'expat/xmlrole.c',
                        'expat/xmltok.c', 'win#expat/loadlibrary.c', 'pyexpat.c'),
                defines=('XML_STATIC', 'win#COMPILED_FROM_DSP',
                        '!win#HAVE_EXPAT_CONFIG_H', '!win#XML_DEV_URANDOM'),
                includepath='expat',
                pyd='pyexpat.pyd'),

Further, I had to #include <Python.h> at the top of loadlibrary.c to prevent the same compile error I was getting if including Qt headers:

1>c:\program files\windows kits\10\include\10.0.17134.0\um\prsht.h(609): error C3646: 'hdr': unknown override specifier
1>c:\program files\windows kits\10\include\10.0.17134.0\um\prsht.h(609): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

I fixed this for the rest of the project by adding a precompiled header in the QMAKE tab in pyqtdeploy with this in it:

#include <Python.h>

#if defined __cplusplus

#include <QtCore>
#include <QtGui>
#include <QtPurchasing>

#endif // __cplusplus

 But this only adds a PCH for .cpp files and not loadlibrary.c, so I’m not sure how to work around this in the long run.

Thoughts?
-Patrick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20181104/f5a3aeba/attachment.html>


More information about the PyQt mailing list