Menu

PythonQt build error

2017-01-27
2017-01-27
  • Jithin Pavithran

    Getting following error while building PythonQt:

    sudo make all
    cd generator/ && make -f Makefile all
    make[1]: Entering directory '/usr/local/PythonQt3.1/generator'
    make -f Makefile.Release all
    make[2]: Entering directory '/usr/local/PythonQt3.1/generator'
    make[2]: Nothing to be done for 'all'.
    make[2]: Leaving directory '/usr/local/PythonQt3.1/generator'
    make -f Makefile.Debug all
    make[2]: Entering directory '/usr/local/PythonQt3.1/generator'
    make[2]: Nothing to be done for 'all'.
    make[2]: Leaving directory '/usr/local/PythonQt3.1/generator'
    make[1]: Leaving directory '/usr/local/PythonQt3.1/generator'
    cd src/ && make -f Makefile all
    make[1]: Entering directory '/usr/local/PythonQt3.1/src'
    g++ -c -m64 -pipe -I/usr/include/python2.7 -I/usr/include/x86_64-linux-gnu/python2.7 -O2 -D_REENTRANT -Wall -W -fPIC -DPYTHONQT_EXPORTS -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I../../../share/qt4/mkspecs/linux-g++-64 -I. -I../../../include/qt4/QtCore -I../../../include/qt4/QtGui -I../../../include/qt4 -I. -I/opt/Qt/5.7/gcc_64/include/QtCore/5.7.0/QtCore -I. -I. -o PythonQt.o PythonQt.cpp
    PythonQt.cpp: In static member function static void PythonQt::init(int, const QByteArray&):
    PythonQt.cpp:258:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (int i = 0; i<sizeof(enumValues)/sizeof(int); i++) {
                          ^
    In file included from /usr/include/python2.7/Python.h:80:0,
                     from PythonQtPythonInclude.h:59,
                     from PythonQtUtils.h:45,
                     from PythonQt.h:45,
                     from PythonQt.cpp:42:
    PythonQt.cpp: In constructor PythonQt::PythonQt(int, const QByteArray&):
    /usr/include/python2.7/object.h:769:22: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
         ((PyObject*)(op))->ob_refcnt++)
                          ^
    PythonQt.cpp:306:3: note: in expansion of macro Py_INCREF
       Py_INCREF(&PythonQtSlotFunction_Type);
       ^
    /usr/include/python2.7/object.h:769:22: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
         ((PyObject*)(op))->ob_refcnt++)
                          ^
    PythonQt.cpp:311:3: note: in expansion of macro Py_INCREF
       Py_INCREF(&PythonQtSignalFunction_Type);
       ^
    /usr/include/python2.7/object.h:769:22: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
         ((PyObject*)(op))->ob_refcnt++)
                          ^
    PythonQt.cpp:316:3: note: in expansion of macro Py_INCREF
       Py_INCREF(&PythonQtSlotDecorator_Type);
       ^
    /usr/include/python2.7/object.h:769:22: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
         ((PyObject*)(op))->ob_refcnt++)
                          ^
    PythonQt.cpp:321:3: note: in expansion of macro Py_INCREF
       Py_INCREF(&PythonQtProperty_Type);
       ^
    /usr/include/python2.7/object.h:769:22: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
         ((PyObject*)(op))->ob_refcnt++)
                          ^
    PythonQt.cpp:327:3: note: in expansion of macro Py_INCREF
       Py_INCREF(&PythonQtBoolResult_Type);
       ^
    /usr/include/python2.7/object.h:769:22: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
         ((PyObject*)(op))->ob_refcnt++)
                          ^
    PythonQt.cpp:335:3: note: in expansion of macro Py_INCREF
       Py_INCREF(&PythonQtClassWrapper_Type);
       ^
    /usr/include/python2.7/object.h:769:22: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
         ((PyObject*)(op))->ob_refcnt++)
                          ^
    PythonQt.cpp:342:3: note: in expansion of macro Py_INCREF
       Py_INCREF(&PythonQtInstanceWrapper_Type);
       ^
    /usr/include/python2.7/object.h:769:22: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
         ((PyObject*)(op))->ob_refcnt++)
                          ^
    PythonQt.cpp:348:3: note: in expansion of macro Py_INCREF
       Py_INCREF(&PythonQtStdOutRedirectType);
       ^
    /usr/include/python2.7/object.h:769:22: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
         ((PyObject*)(op))->ob_refcnt++)
                          ^
    PythonQt.cpp:354:3: note: in expansion of macro Py_INCREF
       Py_INCREF(&PythonQtStdInRedirectType);
       ^
    PythonQt.cpp: In member function void PythonQtPrivate::buildDynamicMetaObject(PythonQtClassWrapper*, const QMetaObject*):
    PythonQt.cpp:1953:20: warning: converting to non-pointer type long int from NULL [-Wconversion-null]
       Py_ssize_t pos = NULL;
                        ^
    PythonQt.cpp:1968:30: warning: variable method set but not used [-Wunused-but-set-variable]
               QMetaMethodBuilder method = builder.addSignal(signal->_dynamicInfo->n
                                  ^
    PythonQt.cpp:1974:7: warning: converting to non-pointer type long int from NULL [-Wconversion-null]
       pos = NULL;
           ^
    PythonQt.cpp: In member function void PythonQtPrivate::callMethodInPython(QMetaMethod&, PythonQtInstanceWrapper*, void**)’:
    PythonQt.cpp:2088:33: error: class QMetaMethod has no member named methodSignature
       QByteArray methodSig = method.methodSignature();
                                     ^
    PythonQt.cpp:2089:70: error: class QMetaMethod has no member named name
       PyObject* func = PyObject_GetAttrString((PyObject*)wrapper, method.name());
                                                                          ^
    In file included from /usr/include/python2.7/Python.h:133:0,
                     from PythonQtPythonInclude.h:59,
                     from PythonQtUtils.h:45,
                     from PythonQt.h:45,
                     from PythonQt.cpp:42:
    PythonQtConversion.h: In instantiation of bool PythonQtConvertPythonToIntegerMap(PyObject*, void*, int, bool) [with MapType = QMap<int, QByteArray>; T = QByteArray; PyObject = _object]:
    PythonQt.cpp:180:5:   required from here
    /usr/include/python2.7/abstract.h:1354:47: warning: deprecated conversion from string constant to char* [-Wwrite-strings]
     #define PyMapping_Items(O) PyObject_CallMethod(O,"items",NULL)
                                                   ^
    PythonQtConversion.h:490:23: note: in expansion of macro PyMapping_Items
         PyObject* items = PyMapping_Items(val);
                           ^
    PythonQtConversion.h: In instantiation of bool PythonQtConvertPythonToIntegerMap(PyObject*, void*, int, bool) [with MapType = QMap<int, QVariant>; T = QVariant; PyObject = _object]:
    PythonQt.cpp:181:5:   required from here
    /usr/include/python2.7/abstract.h:1354:47: warning: deprecated conversion from string constant to char* [-Wwrite-strings]
     #define PyMapping_Items(O) PyObject_CallMethod(O,"items",NULL)
                                                   ^
    PythonQtConversion.h:490:23: note: in expansion of macro PyMapping_Items
         PyObject* items = PyMapping_Items(val);
                           ^
    PythonQtConversion.h: In instantiation of bool PythonQtConvertPythonToIntegerMap(PyObject*, void*, int, bool) [with MapType = QMap<int, QString>; T = QString; PyObject = _object]:
    PythonQt.cpp:182:5:   required from here
    /usr/include/python2.7/abstract.h:1354:47: warning: deprecated conversion from string constant to char* [-Wwrite-strings]
     #define PyMapping_Items(O) PyObject_CallMethod(O,"items",NULL)
                                                   ^
    PythonQtConversion.h:490:23: note: in expansion of macro PyMapping_Items
         PyObject* items = PyMapping_Items(val);
                           ^
    PythonQtConversion.h: In instantiation of bool PythonQtConvertPythonToIntegerMap(PyObject*, void*, int, bool) [with MapType = QHash<int, QByteArray>; T = QByteArray; PyObject = _object]:
    PythonQt.cpp:183:5:   required from here
    /usr/include/python2.7/abstract.h:1354:47: warning: deprecated conversion from string constant to char* [-Wwrite-strings]
     #define PyMapping_Items(O) PyObject_CallMethod(O,"items",NULL)
                                                   ^
    PythonQtConversion.h:490:23: note: in expansion of macro PyMapping_Items
         PyObject* items = PyMapping_Items(val);
                           ^
    PythonQtConversion.h: In instantiation of bool PythonQtConvertPythonToIntegerMap(PyObject*, void*, int, bool) [with MapType = QHash<int, QVariant>; T = QVariant; PyObject = _object]:
    PythonQt.cpp:184:5:   required from here
    /usr/include/python2.7/abstract.h:1354:47: warning: deprecated conversion from string constant to char* [-Wwrite-strings]
     #define PyMapping_Items(O) PyObject_CallMethod(O,"items",NULL)
                                                   ^
    PythonQtConversion.h:490:23: note: in expansion of macro PyMapping_Items
         PyObject* items = PyMapping_Items(val);
                           ^
    PythonQtConversion.h: In instantiation of bool PythonQtConvertPythonToIntegerMap(PyObject*, void*, int, bool) [with MapType = QHash<int, QString>; T = QString; PyObject = _object]:
    PythonQt.cpp:185:5:   required from here
    /usr/include/python2.7/abstract.h:1354:47: warning: deprecated conversion from string constant to char* [-Wwrite-strings]
     #define PyMapping_Items(O) PyObject_CallMethod(O,"items",NULL)
                                                   ^
    PythonQtConversion.h:490:23: note: in expansion of macro PyMapping_Items
         PyObject* items = PyMapping_Items(val);
                           ^
    Makefile:368: recipe for target 'PythonQt.o' failed
    make[1]: *** [PythonQt.o] Error 1
    make[1]: Leaving directory '/usr/local/PythonQt3.1/src'
    Makefile:87: recipe for target 'sub-src-all-ordered' failed
    make: *** [sub-src-all-ordered] Error 2
    

    How to fix this?

     
  • Florian Link

    Florian Link - 2017-01-27

    Looks like you try to build against Qt 4.8. The PythonQt snv trunk does not support Qt4 anymore, only Qt5. For PythonQt on Qt 4.8, have a look at the svn braches, there is a branch of the last working version for Qt4

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.