[Kde-bindings] smoke/kde compile problem

Dominique Devriese devriese at kde.org
Wed Jul 21 21:31:52 UTC 2004


Hi,

I'm having a problem compiling smoke/kde.  It fails on the following
code: 
    static void x_0(Smoke::Stack x) {
        // operator<<(kdbgstream&, const DOM::DOMString&)
        kdbgstream& xret = DOM::operator<<(*(kdbgstream
        *)x[1].s_voidp,*(const DOM::DOMString *)x[2].s_class);
        x[0].s_voidp = (void*)&xret;
    }

With the following error:
    x_1.cpp: In static member function `static void
    x_DOM::x_0(Smoke::StackItem*)':
    x_1.cpp:1034: error: invalid initialization of reference of type
    'kndbgstream&'
       from expression of type 'kdbgstream'
    /usr/include/kde/dom/dom_string.h:124: error: in passing argument 1 of
    `
       kndbgstream& DOM::operator<<(kndbgstream&, const DOM::DOMString&)'
    make: *** [x_1.lo] Error 1

When compiling with the following command:
    if /bin/sh ../../libtool --silent --mode=compile --tag=CXX g++
    -DHAVE_CONFIG_H -I. -I. -I../.. -I./.. -I/usr/include/kde
    -I/usr/share/qt3/include -I.   -DQT_THREAD_SUPPORT  -D_REENTRANT
    -Wnon-virtual-dtor -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500
    -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W
    -Wpointer-arith -Wwrite-strings -DNDEBUG -DNO_DEBUG -O2
    -Wformat-security -Wmissing-format-attribute -fno-exceptions
    -fno-check-new -fno-common  -MT x_1.lo -MD -MP -MF ".deps/x_1.Tpo" -c
    -o x_1.lo x_1.cpp; \
    then mv -f ".deps/x_1.Tpo" ".deps/x_1.Plo"; else rm -f
    ".deps/x_1.Tpo"; exit 1; fi

I'm compiling without debugging support.  The problem seems to be
coming from the following code in kdelibs/khtml/dom/dom_string.h

    #ifndef NDEBUG
    inline kdbgstream &operator<<(kdbgstream &stream, const DOMString &string) {
            return (stream << string.string());
    }
    #else
    inline kndbgstream &operator<<(kndbgstream &stream, const DOMString &) {
            return stream;
    }
    #endif

The problem is clearly that it's trying to wrap the wrong operator<<,
but I don't know how to make it do the right thing instead, as I have
no knowledge of kalyptus.  Does anyone know how to fix this and if so,
would they be so kind as to commit a patch ?  Feel free to ask for
more information if you need it.

cheers
domi



More information about the Kde-bindings mailing list