Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Anyone using Shiboken6 and Visual Studio succesfully?

Anyone using Shiboken6 and Visual Studio succesfully?

Scheduled Pinned Locked Moved Unsolved Qt for Python
3 Posts 2 Posters 654 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • JorganMonesJ Offline
    JorganMonesJ Offline
    JorganMones
    wrote on last edited by JorganMones
    #1

    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\samplebinding

    Shiboken 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!

    1 Reply Last reply
    0
    • F Offline
      F Offline
      friedemannkleint
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • JorganMonesJ Offline
        JorganMonesJ Offline
        JorganMones
        wrote on last edited by
        #3

        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:
        2022-08-10 15_52_30-Window.png

        Modules loaded:
        2022-08-10 15_52_59-Window.png

        Module Dependencies
        2022-08-10 16_00_24-Window.png

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved