Anyone using Shiboken6 and Visual Studio succesfully?
-
I am trying to get the simple bindings example working as posted here:
https://www.qt.io/blog/2018/05/31/write-python-bindings
Am getting an access violation exception when loading a python module from the Shiboken generated PyInit_ routine:
extern "C" LIBSHIBOKEN_EXPORT PyObject *PyInit_ShibokenTest() { ... ... PyObject *module = Shiboken::Module::create("ShibokenTest", &moduledef);
Always throws.
My environment:
Python 310 (binary)
Pyside6 (6.3 from wheels)
Shiboken6 (6.3 from wheels)(
CLang (libclang-release_140-based-windows-vs2019_64)
VisualStudio 2019
PySide6\examples\samplebindingShiboken generator appears to work correctly, with the exception of this warning:
(shibokentest) [237ms] Detecting inconsistencies in typesystem (87)... qt.shiboken: (shibokentest) D:\ShibokenTest\src\icecream.h:71: skipping function 'std::ostream& Icecream::operator<<(std::ostream&,const Icecream&)', unmatched return type 'std::ostream&': Unable to translate type "std::ostream&": Cannot find type entry for "std::ostream".
Anyone have this working under Windows / Visual Studio?
Edit : Pyside/shiboken minor versions
Thanks!
-
This is tracked in https://bugreports.qt.io/browse/PYSIDE-1962 . So far there is no conclusion yet. It seems to happen only in some setups; sometimes for debug builds, sometimes for all. Any help is greatly appreciated.
-
Revisiting this. Reviewing https://bugreports.qt.io/browse/PYSIDE-1962 , I've tried the suggested workarounds but none resolve, and don't exactly seem applicable.
It appears from the call stack that the shiboken6.abi3.dll module is not loaded, so any call into the shiboken namespace fails. For example, for the 'simple bindings' example, i've moved a call into shiboken before the create call, and still get the exception. The Visual Studio output window shows the 'shiboken6.abi3.dll' is not getting loaded, which is where these shiboken calls seem to be located. Checking the shiboken6.abi3.dll dependencies, it all looks correct.
Soooooo, my 'feeling' is there is some reason the shiboken6.abi3.dll dependency is not getting loaded. This is the samwe behavior in either debug or releaser builds of the example app, using either the debug or release python interpreter.
Since this is from the wheels install of Shiboken, there is no debug version of the shiboken6.abi3.dll, but the pyd does not seem to indicate that dependency (see attached image - ShibokenTest.pyd is the sample bindings example).
Call Stack:
Modules loaded:
Module Dependencies