[Kde-bindings] making smoke/korundum generate bindings for other things?

Richard Dale Richard_Dale at tipitina.demon.co.uk
Thu Jun 23 10:52:10 UTC 2005

On Thursday 23 June 2005 00:32, Gábor Lehel wrote:
> On 6/22/05, Richard Dale <Richard_Dale at tipitina.demon.co.uk> wrote:
> > On Wednesday 22 June 2005 20:07, Gábor Lehel wrote:
> > > Hi,
> > > how hardwired is smoke/korundum to the existing kdelibs? eg, if I
> > > wanted to make it generate bindings for kdenonbeta/kcanvas, how hard
> > > would it be? (and how would I go about it?)
> > > I tried doing it the 'dumb way' (eg, without trying to figure out how
> > > any of it actually works) by making a symlink for kdenonbeta/kcanvas
> > > at kdelibs/kcanvas, and adding all the headers to
> > > smoke/kde/kde_headers_list, lines for all the classes to
> > > kalyptus/kalyptusDataDict.pm, and finally adding -lkcanvas to
> > > smoke/kde/Makefile.am, and it even compiled, but it doesn't seem to
> > > have actually had any effect (eg, no classes called KDE::Canvas*).
> > > the reason i want to do this is that kcanvas looks cool and I want to
> > > play around with it, and playing around is much funner in ruby =).
> >
> > You don't need to add the classes to kalyptus/kalyptusDataDict.pm, but
> > other than that what you did should have worked. Is KCanvas in a
> > namespace, is that the problem?
> No, it's not in a namespace. It seems the problem was actually that I
> included the leading kcanvas/ in the path for all the headers in
> kde_headers_list. Removing them seems to have had some effect, namely
> that it now fails to compile: (tried making clean and all that)
> make[1]: Entering directory `/opt/kde/build/KDE/kdebindings/korundum/bin'
> /bin/sh ../../libtool --silent --mode=link --tag=CXX g++
> -Wnon-virtual-dtor -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500
> -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W
> -Wpointer-arith -Wno-non-virtual-dtor -g3 -fno-inline
> -Wformat-security -Wmissing-format-attribute -fno-exceptions
> -fno-check-new -fno-common    -o krubyinit -module -L/opt/kde/dest/lib
> -L/usr/qt/3/lib -L/usr/lib    -version-info 0:0:0
> -L/opt/kde/src/KDE/kdebindings/smoke/kde/ -L/usr/lib krubyinit.o
> -Wl,-R -Wl,/usr/lib -L/usr/lib -L. -lruby18
> ../../smoke/kde/libsmokekde.la
> ../../qtruby/rubylib/qtruby/libqtrubyinternal.la
> libtool: link: warning: `-version-info' is ignored for programs
> /opt/kde/dest/lib/libkcanvas.so: undefined reference to
> `KRenderingDevice::pushContext(KRenderingDeviceContext*)'
> /opt/kde/dest/lib/libkcanvas.so: undefined reference to
> `KRenderingDevice::popContext()'
> /opt/kde/dest/lib/libkcanvas.so: undefined reference to
> `KRenderingDeviceContext::setStyle(KRenderingStyle*)'
> /opt/kde/dest/lib/libkcanvas.so: undefined reference to
> `KRenderingFillPainter::paintServer() const'
> /opt/kde/dest/lib/libkcanvas.so: undefined reference to
> `KRenderingDevice::setCurrentPath(void*)'
> /opt/kde/dest/lib/libkcanvas.so: undefined reference to
> `KRenderingStrokePainter::paintServer() const'
> /opt/kde/dest/lib/libkcanvas.so: undefined reference to
> `KRenderingDeviceContext::setCanvas(KCanvas*)'
> /opt/kde/dest/lib/libkcanvas.so: undefined reference to
> `KRenderingDevice::currentPath() const'
> /opt/kde/dest/lib/libkcanvas.so: undefined reference to
> `KRenderingDevice::currentContext()'
> /opt/kde/dest/lib/libkcanvas.so: undefined reference to
> `KRenderingDeviceContext::setPath(void*)'
> collect2: ld returned 1 exit status
> make[1]: *** [krubyinit] Error 1
> make[1]: Leaving directory `/opt/kde/build/KDE/kdebindings/korundum/bin'
> make: *** [all-recursive] Error 1
> I'm completely ignorant with regards to how the whole linking thing
> works... any idea what the problem could be? Thanks for the help.
I've checked out kdenonbeta and built libkcanvas now. It looks like you need 
to link against libkcanvasdevice and libkdecore too. And I think you will 
need to include the header for KRendingDevice from kcanvas/device as it is 
used in the KCanvas constructor.

You may need to add custom marshallers for converting C++ lists to ruby ones 
and back too.

In kalyptus/kalyptusCXXtoSmoke.pm there is this line which defines the header 
subdirectories (it shouldn't really be hard coded like this):

$headerSubdirectories = 

You could add 'kcanvas/device|kcanvas|' to the front of that, so you don't 
need to add '-I' include paths for them in the Makefile.am.

-- Richard

More information about the Kde-bindings mailing list