Menu

Linux compilation

Help
bizaro
2016-11-06
2016-11-11
  • bizaro

    bizaro - 2016-11-06

    Hello,

    On my system I have :
    python 2.7.12 & QT5.7

    python.prf is : 2.7.

    during the building of PythonQt I obtain :

    PythonQt.cpp:1932:42: fatal error: private/qmetaobjectbuilder_p.h: Aucun fichier ou dossier de ce type
    #include <private qmetaobjectbuilder_p.h="">
    ^
    compilation terminated.
    Makefile:368 : la recette pour la cible « PythonQt.o » a échouée
    make[1]: [PythonQt.o] Erreur 1
    make[1] : on quitte le répertoire « /usr/local/PythonQt3.1/src »
    Makefile:79 : la recette pour la cible « sub-src-make_default-ordered » a échouée
    make:
    [sub-src-make_default-ordered] Erreur 2

    What I'm doing wrong?

     
  • Florian Link

    Florian Link - 2016-11-07

    You are missing core-private, the private headers for QtCore.
    Maybe you did not compile/install Qt completely?

     
    • Sander Stoks

      Sander Stoks - 2016-11-07

      Hello,

      For certain features (such as the built-in help() function), Python checks whether it’s a tty. When you’re making an embedded console in PythonQt, this didn’t work. The patch below adds this to stdin.

      Kind regards,
      Sander Stoks

      Index: PythonQtStdIn.cpp

      --- PythonQtStdIn.cpp (revision 441)
      +++ PythonQtStdIn.cpp (working copy)
      @@ -61,10 +61,17 @@
      return Py_BuildValue("s", string.toLatin1().constData());
      }

      +static PyObject PythonQtStdInRedirect_isatty(PyObject * /self/)
      +{
      + Py_RETURN_TRUE;
      +}
      +
      static PyMethodDef PythonQtStdInRedirect_methods[] = {
      {"readline", (PyCFunction)PythonQtStdInRedirect_readline, METH_VARARGS,
      "read input line"},
      - {NULL, NULL, 0 , NULL} /
      sentinel /
      + {"isatty", (PyCFunction)PythonQtStdInRedirect_isatty, METH_NOARGS,
      + "is this a tty"},
      + {NULL, NULL, 0 , NULL} /
      sentinel */
      };

      static PyMemberDef PythonQtStdInRedirect_members[] = {

       
    • bizaro

      bizaro - 2016-11-07

      Hi,
      I don't have the qmetaobjectbuilder_p.h, so I add the sources with the qt maintenance tool. because you tell me about the private headers for QtCore. thank you :)

      The make build the libPythonQt.so and libPythonQt_QtAll.so and stop again.

      don't find :
      PyUnicodeUCS2_decodeUTF16 and PyUnicodeUCS2_AsUTF8String :(

      thank you for your help .

       
      • Sander Stoks

        Sander Stoks - 2016-11-08

        Hi,

        For future readers: if you were using apt-get to install Qt in your system, you can get this header by doing

        sudo apt-get install qtbase5-private-dev

        Regards,
        Sander

        On 7 Nov 2016, at 21:31, bizaro bizaro@users.sf.net wrote:

        Hi,
        I don't have the qmetaobjectbuilder_p.h, so I add the sources with the qt maintenance tool. because you tell me about the private headers for QtCore. thank you :)

        The make build the libPythonQt.so and libPythonQt_QtAll.so and stop again.
        don't find :
        PyUnicodeUCS2_decodeUTF16 and PyUnicodeUCS2_AsUTF8String :(

        thank you for your help .

        Linux compilation https://sourceforge.net/p/pythonqt/discussion/631393/thread/69eb9ccb/?limit=25#355d/7b88
        Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/pythonqt/discussion/631393/ https://sourceforge.net/p/pythonqt/discussion/631393/
        To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/ https://sourceforge.net/auth/subscriptions/

         
        👍
        1
        • bizaro

          bizaro - 2016-11-09

          Ok i will try that..

          thanks you

           
          • bizaro

            bizaro - 2016-11-11

            Both windows or linux make have a problem with PythonQTdecorators...

             
  • bizaro

    bizaro - 2016-11-07

    Thank you for your answer.

    I change the original PythonQtStdln.cpp for that :

    #include "PythonQtStdIn.h"
    
    static PyObject *PythonQtStdInRedirect_new(PyTypeObject *type, PyObject * /*args*/, PyObject * /*kwds*/)
    {
      PythonQtStdInRedirect *self;
      self = (PythonQtStdInRedirect *)type->tp_alloc(type, 0);
      self->_cb = NULL;
      self->_callData = NULL;
    
      return (PyObject *)self;
    }
    
    static PyObject *PythonQtStdInRedirect_readline(PyObject * self, PyObject * args)
    {
      PythonQtStdInRedirect*  s = (PythonQtStdInRedirect*)self;
      QString string;
      if (s->_cb) {
        string =  (*s->_cb)(s->_callData);
        }
      return Py_BuildValue("s", string.toLatin1().constData());
    }
    
    static PyObject PythonQtStdInRedirect_isatty(PyObject * self)
    {
     Py_RETURN_TRUE;
    }
    
    static PyMethodDef PythonQtStdInRedirect_methods[] = {
      {"readline", (PyCFunction)PythonQtStdInRedirect_readline, METH_VARARGS,
       "read input line"},
     {"isatty", (PyCFunction)PythonQtStdInRedirect_isatty, METH_NOARGS,
     "is this a tty"},
     {NULL, NULL, 0 , NULL} 
    };
    
    static PyMemberDef PythonQtStdInRedirect_members[] = {
      {NULL}  
    };
    
    PyTypeObject PythonQtStdInRedirectType = {
        PyVarObject_HEAD_INIT(NULL, 0)
        "PythonQtStdInRedirect",             /*tp_name*/
        sizeof(PythonQtStdInRedirect),             /*tp_basicsize*/
        0,                         /*tp_itemsize*/
        0, /*tp_dealloc*/
        0,                         /*tp_print*/
        0,                         /*tp_getattr*/
        0,                         /*tp_setattr*/
        0,           /*tp_compare*/
        0,              /*tp_repr*/
        0,                         /*tp_as_number*/
        0,                         /*tp_as_sequence*/
        0,                         /*tp_as_mapping*/
        0,                         /*tp_hash */
        0,                         /*tp_call*/
        0,                         /*tp_str*/
        0,                         /*tp_getattro*/
        0,                         /*tp_setattro*/
        0,                         /*tp_as_buffer*/
        Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
        "PythonQtStdInRedirect",           /* tp_doc */
        0,                   /* tp_traverse */
        0,                   /* tp_clear */
        0,                   /* tp_richcompare */
        0,                   /* tp_weaklistoffset */
        0,                   /* tp_iter */
        0,                   /* tp_iternext */
        PythonQtStdInRedirect_methods,                   /* tp_methods */
        PythonQtStdInRedirect_members,                   /* tp_members */
        0,                   /* tp_getset */
        0,                         /* tp_base */
        0,                         /* tp_dict */
        0,                         /* tp_descr_get */
        0,                         /* tp_descr_set */
        0,                         /* tp_dictoffset */
        0,                         /* tp_init */
        0,                         /* tp_alloc */
        PythonQtStdInRedirect_new,                 /* tp_new */
    };
    

    during the make step I obtain this error :
    "
    In file included from /usr/local/include/python2.7/Python.h:87:0,
    from PythonQtPythonInclude.h:59,
    from PythonQtStdIn.h:46,
    from PythonQtStdIn.cpp:42:
    /usr/local/include/python2.7/boolobject.h:24:46: error: could not convert ‘(((void)(((PyObject)(& _Py_TrueStruct))->_object::ob_refcnt ++)), ((PyObject)(& _Py_TrueStruct)))’ from ‘PyObject {aka _object}’ to ‘PyObject {aka _object}’
    #define Py_True ((PyObject *) &_Py_TrueStruct)

    best regards,

     
    • Sander Stoks

      Sander Stoks - 2016-11-07

      Hello,

      My apologies - my patch was for an unrelated issue, not related to Linux compilation. I thought I was posting a new topic.

      Regards,
      Sander Stoks

       

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.