mixing PyQt(5) and Boost.Python
Phil Thompson
phil at riverbankcomputing.com
Tue Sep 21 11:34:32 BST 2021
On 20/09/2021 20:49, Stefan Seefeld wrote:
> ...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 ?
See...
https://www.riverbankcomputing.com/static/Docs/sip/c_api.html#using-the-c-api-when-embedding
Phil
-------------- 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/20210921/1e87eb42/attachment.png>
More information about the PyQt
mailing list