mixing PyQt(5) and Boost.Python

Stefan Seefeld stefan at seefeld.name
Mon Sep 20 20:49:26 BST 2021


...and a follow-up question:

My current C++ code looks (roughly) like this:

---
#include <sip.h>

extern const sipAPIDef *sipAPI_QtQml;
extern sipClassTypeDef sipTypeDef_QtQml_QQmlApplicationEngine;

bpl::object get_pyqt_qml_engine(bpl::object &self)
{
   auto engine = sipAPI_QtQml->qpi_convert_from_new_type(get_qml_engin(),
&sipTypeDef_QtQml_QQmlApplicationEngine.ctd_base,
                                                self.ptr())));
   return bpl::objec(bpl::handle<>(engine));
}
---

When I compile the above into my extension module and try to load 
(import) it into my Python process, I get a missing-symbol error for 
`sipTypeDef_QtQml_QQmlApplicationEngine`. Is there anything else I need 
to do to get this symbol to be properly resolved ?

(In fact, I notice that the symbol appears to be provided by the 
`PyQt.QtQml` module, so I'm importing this prior to importing the above.

I also tried setting the `os.RTLD_GLOBAL` loader flag, though that may 
actually result in ODR violations in other parts of the application...

Any advice on how to proceed ?


Thanks !

Stefan

-- 

       ...ich hab' noch einen Koffer in Berlin...

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20210920/8f9582b8/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .signature.png
Type: image/png
Size: 2754 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20210920/8f9582b8/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stefan.vcf
Type: text/x-vcard
Size: 4 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20210920/8f9582b8/attachment-0001.vcf>


More information about the PyQt mailing list