Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. PySide 1.2.1 compilation problem in samplebinding
Forum Updated to NodeBB v4.3 + New Features

PySide 1.2.1 compilation problem in samplebinding

Scheduled Pinned Locked Moved Language Bindings
3 Posts 1 Posters 1.7k Views 1 Watching
  • 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.
  • R Offline
    R Offline
    rhialto
    wrote on last edited by
    #1

    I'm trying to build shiboken-1.2.1.tar.bz2 on a NetBSD 6.1.1 machine. I seem to be running into a little code generation bug in the generated test code.

    My build proceeds this far:
    @[ 91%] Building CXX object tests/samplebinding/CMakeFiles/sample.dir/sample/samplenamespace_someclass_someinnerclass_okthisisrecursiveenough_wrapper.cpp.o
    [ 91%] Building CXX object tests/samplebinding/CMakeFiles/sample.dir/sample/samplenamespace_someclass_someinnerclass_wrapper.cpp.o
    [ 92%] Building CXX object tests/samplebinding/CMakeFiles/sample.dir/sample/samplenamespace_someclass_someotherinnerclass_wrapper.cpp.o
    [ 92%] Building CXX object tests/samplebinding/CMakeFiles/sample.dir/sample/samplenamespace_someclass_wrapper.cpp.o
    [ 92%] Building CXX object tests/samplebinding/CMakeFiles/sample.dir/sample/samplenamespace_derivedfromnamespace_wrapper.cpp.o
    [ 93%] Building CXX object tests/samplebinding/CMakeFiles/sample.dir/sample/simplefile_wrapper.cpp.o
    /home/tmp/wip/py-pyside-shiboken/work.x86_64/shiboken-1.2.1/build/tests/samplebinding/sample/simplefile_wrapper.cpp: In function 'PyObject* Sbk_SimpleFileFunc_filename(PyObject*)':
    /home/tmp/wip/py-pyside-shiboken/work.x86_64/shiboken-1.2.1/build/tests/samplebinding/sample/simplefile_wrapper.cpp:228:50: error: invalid conversion from 'const char*' to 'char*'
    gmake[2]: *** [tests/samplebinding/CMakeFiles/sample.dir/sample/simplefile_wrapper.cpp.o] Error 1
    gmake[1]: *** [tests/samplebinding/CMakeFiles/sample.dir/all] Error 2
    gmake: *** [all] Error 2
    *** Error code 2

    Stop.
    make: stopped in /mnt/vol1/rhialto/cvs/pkgsrc/wip/py-pyside-shiboken
    *** Error code 1

    Stop.
    make: stopped in /mnt/vol1/rhialto/cvs/pkgsrc/wip/py-pyside-shiboken@

    Looking at the code at that place, I see
    @
    if (!PyErr_Occurred()) {
    // filename()
    PyThreadState* _save = PyEval_SaveThread(); // Py_BEGIN_ALLOW_THREADS
    char * cppResult = cppSelf->filename();
    PyEval_RestoreThread(_save); // Py_END_ALLOW_THREADS
    pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<const char*>(), cppResult);
    }
    @
    where the compiler complains about the @char * cppResult = cppSelf->filename();@ in the middle.
    As far as I can see, g++ (gcc version 4.5.3 (NetBSD nb2 20110806) ) is correct. The filename() method returns a const char *. That seems to match what's in ..../tests/libsample/simplefile.h

    It seems incorrect code generation that this is assigned to a plain char *.

    How do I get over this hurdle?

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rhialto
      wrote on last edited by
      #2

      From a private mail (on a pkgsrc-wip mailing list) I got the suggestion to use gcc 4.8. I tried that,
      but it didn't help with the main issue. However, the error message was
      modified a bit and referred to an option "-fpermissive". I patched that
      one into the build system in 2 places, and that papered over the problem.
      The errors (they occurred a few times) were downgraded to warnings.

      With that, I pressed on with the next part, PySide proper.

      Here also it seems that the shiboken code generator forgets about
      "const" in some locations. The first error is when a function definition

      @const QMetaObject* QAbstractEventDispatcherWrapper::metaObject() const@

      doesn't match the appropriate declaration

      @virtual QMetaObject * metaObject();@
      

      Moreover, the Qt header file Qt/qabstracteventdispatcher.h which defines QAbstractEventDispatcher makes it have a method

      @virtual QList<TimerInfo> registeredTimers(QObject *object) const = 0;@
      

      which is improperly overridden in the QAbstractEventDispatcherWrapper:

      @virtual QList<QPair<int, int > > registeredTimers(QObject * object);@
      

      which means that the abstract function isn't implemented, and the QAbstractEventDispatcherWrapper object can't be instantiated.

      I do notice again a discrepancy in "const"s. Both files were in the
      build directory, hence generated (by "shiboken", presumably), but I
      don't know from what or where yet.

      This unfortunately means that the problem is very real.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rhialto
        wrote on last edited by
        #3

        I found it. @__STDC__@ should be #defined as "1", not empty.
        I posted a bug report at https://bugreports.qt-project.org/browse/PYSIDE-206 .

        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