When installing Shiboken (both separately from PySide and with it), a compilation error occurs under pip . Error text:

 C:\Users\***\AppData\Local\Temp\pip-build-l7ifih_w\Shiboken\sources\shiboken\libshiboken\basewrapper.cpp:773:45: error: cast from 'PyObject* {aka _object*}' to 'Py_hash_t {aka int}' loses precision [-fpermissive] return reinterpret_cast<Py_hash_t>(pyObj); ^ error: Error compiling shiboken 

Installation command:

 pip install --global-option="--make-spec=mingw" PySide (или Shiboken) 

Used: Python 3.4; MinGW-w64 (gcc 4.9.3); CMake 3.7.0 Python 3.4; MinGW-w64 (gcc 4.9.3); CMake 3.7.0

How to solve this problem?

    1 answer 1

    Apparently, the problem is that the pointer is 64-bit, and int is 32-bit. The easiest way is to replace a synonym of the Py_hash_t type with an int to some int64_t . But whether this method is correct is not clear. The answer to this question is better to look at the support service Shiboken .

    • I demolished MinGW64 and re-installed the normal one, the error disappeared, though the project never got together (it could not find one file). Apparently your assumption is completely true. I will try to fix it, thanks) - DiA
    • I asked a similar question on the main stack, you can post your answer: stackoverflow.com/questions/40523607/… - DiA