Re: [PyQt] PyQt / SIP from an embedded Python interpreter
Hi, On 8 June 2013 11:00, Phil Thompson p...@riverbankcomputing.com wrote: On Fri, 7 Jun 2013 23:44:17 +0200, Johan Thelin johan.the...@pelagicore.com wrote: Hi, I've been experimenting with using PyQt and SIP from a Python interpreter embedded into a larger C++ application. I do this on Linux (Kubuntu 13.04), Qt 5 and PyQt/SIP from last Wednesday (June 5th). This gives me an unresolved symbol, _Py_NoneStruct, when importing PyQt5.QtCore. However, adding -lpython2.7 to sip and QtCore, it works. I guess the import statement does a dlopen, and it fails to resolve the symbols, despite them being linked into my host application for some odd reason. So, to the point. Am I doing something wrong here? Should things just work? I've tried the -Wl,-E and -rdynamic, which was what Google indicated could help. Alas, no luck with them. You could look at how the Designer plugin is built as that is doing something similar. If I'm not doing something wrong, do you want my patches to SIP and PyQt5? Always happy to consider patches. I've attached the patch that I've applied to PyQt5 snapshot. It relies on pkg-config, which, imho, is the right way to do it, but adds a build-time dependency to PyQt. The same effect could be achieved by hardcoding the LIBS variable to include -lpython2.7. As for sip, I've successfully built it after having configured it with a LIBS+=-lpython2.7. Now the import works flawlessly, even from my embedded interpretor. Cheers, Johan Thelin pyqt-pkgconfig-python.patch Description: Binary data ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] PyQt / SIP from an embedded Python interpreter
On Fri, 7 Jun 2013 23:44:17 +0200, Johan Thelin johan.the...@pelagicore.com wrote: Hi, I've been experimenting with using PyQt and SIP from a Python interpreter embedded into a larger C++ application. I do this on Linux (Kubuntu 13.04), Qt 5 and PyQt/SIP from last Wednesday (June 5th). This gives me an unresolved symbol, _Py_NoneStruct, when importing PyQt5.QtCore. However, adding -lpython2.7 to sip and QtCore, it works. I guess the import statement does a dlopen, and it fails to resolve the symbols, despite them being linked into my host application for some odd reason. So, to the point. Am I doing something wrong here? Should things just work? I've tried the -Wl,-E and -rdynamic, which was what Google indicated could help. Alas, no luck with them. You could look at how the Designer plugin is built as that is doing something similar. If I'm not doing something wrong, do you want my patches to SIP and PyQt5? Always happy to consider patches. Phil ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] PyQt / SIP from an embedded Python interpreter
Hi, I've been experimenting with using PyQt and SIP from a Python interpreter embedded into a larger C++ application. I do this on Linux (Kubuntu 13.04), Qt 5 and PyQt/SIP from last Wednesday (June 5th). This gives me an unresolved symbol, _Py_NoneStruct, when importing PyQt5.QtCore. However, adding -lpython2.7 to sip and QtCore, it works. I guess the import statement does a dlopen, and it fails to resolve the symbols, despite them being linked into my host application for some odd reason. So, to the point. Am I doing something wrong here? Should things just work? I've tried the -Wl,-E and -rdynamic, which was what Google indicated could help. Alas, no luck with them. If I'm not doing something wrong, do you want my patches to SIP and PyQt5? Cheers, Johan Thelin ヨハン テリン M.Sc.E.E. System Architect Pelagicore AB Ekelundsgatan 4, 6tr, SE-411 18 Gothenburg, Sweden Mobile: +46 (0)700 900 250 Skype: jothpelagicore E-Mail: johan.the...@pelagicore.com ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt