Hi all,<br><br>My setup: Windows 32-bit, Visual Studio 2008, PyQt 4.4.4, Qt 4.4.3, sip 4.7.9.<br><br>I need to build SIP, Python and PyQt statically. I can get everything to build and link but I cannot figure out how to correctly initialize PyQt so that Python finds it as a builtin module.<br>
<br>This message:<br><br><a href="http://thread.gmane.org/gmane.comp.python.pyqt-pykde/14422/focus=14425">http://thread.gmane.org/gmane.comp.python.pyqt-pykde/14422/focus=14425</a><br><br>covers what I need except for the exact syntax of the call to PyImport_ExtendInittab()<br>
<br>I duplicated what this poster tried (w/ the same results):<br><br><a href="http://lists.kde.org/?l=pykde&m=116959724322512&w=2">http://lists.kde.org/?l=pykde&m=116959724322512&w=2</a><br><br>I added the following code to my python interpreter executable:<br>
<br>extern void initsip(void);<br>extern void initQtCore(void);<br>extern void initQtGui(void);<br>struct _inittab pyqt_inittab[] = {<br> {"sip", initsip}<br> {"PyQt4.QtCore", initQtCore},<br> {"PyQt4.QtGui", initQtGui}<br>
{0, 0}<br>};<br>int main(int argc, char **argv)<br>{<br> PyImport_ExtendInittab(pyqt_inittab);<br> Py_Initialize();<br>...<br><br>The python interpeter executable builds and links, but running the PyQt/examples/tutorial/t1.pyw example script returns the error:<br>
<br>Traceback (most recent call last):<br> File "t1.pyw", line 7, in <module><br> from PyQt4 import QtGui<br>ImportError: cannot import name QtGui<br>[13350 refs]<br><br>Can anybody please provide me the correct inittab entries for a static PyQt?<br>
<br>Thanks,<br><br>-McKay Davis<br>