Latest version in trunk (441) failed to compile
Dynamic Python binding for Qt Applications
Brought to you by:
florianlink,
marcusbarann
Hi,
I'm trying to compile latest version from trunk for python2 and I got these errors. I tried to replace the PyMapping_Items
by PyObject_Repr, the errors were gone; however, examples kept crashing.
C:\lib\PythonQt3.1_py2\src\PythonQtConversion.h:490: error: C2664: 'PyObject *PyObject_CallMethod(PyObject *,char *,char *,...)': cannot convert argument 2 from 'const char [6]' to 'char *'
C:\lib\PythonQt3.1_py2\src\PythonQtConversion.cpp:954: error: C2664: 'PyObject *PyObject_CallMethod(PyObject *,char *,char *,...)': cannot convert argument 2 from 'const char [6]' to 'char *'
Using Python3 the latest version in trunk working fine, except for Python_Launcher example keeping crashing.
My setup:
Windows 10 64bit v1607
Python: 2.7.12 under Miniconda3
Qt: 5.7 msvc14
I've been trying to build the project using qt-creator.
Any help would be appreciated.
Last edit: Brian 2016-08-30
I think you have to relax the compiler settings to allow conversion to char pointer on the Python C api.
alternatively you can add a const_cast to fix the places.
Hi Florian,
I'm not sure how to set such options (-Zc:strictStrings-) in Qt-Creator. Can you elaborate more on this?
Last edit: Brian 2016-08-30
It seems to be fine when I set to QMAKE_CXXFLAGS+= -Zc:strictStrings-
After a while the building is successful, however, examples are still crashed. Hm...
After a few trying, I think it was the Miniconda3 python2 packages was the problem. I installed the distribution from python official site and there's no more crashing.