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

Gábor Lehel illissius at gmail.com
Fri Jun 24 23:27:59 UTC 2005


On 6/24/05, Richard Dale <Richard_Dale at tipitina.demon.co.uk> wrote:
> > What am I doing wrong?
> Did you remove the .cpp files from smoke/kde before typing make?
> It won't regenerate the C++ code until you remove them.
D'oh! Told you I was doing something stupid ;).

Anyways, I've managed to get it to build now. First it died when
generating smokedata.cpp, with errors like KCanvasImage has unkown
parent KCanvasResource (and prior to that warnings that it doesn't
know KCanvasResource), and same thing for
KRenderingDeviceServerPattern (iirc), so I just removed those two
headers from the list for now as they didn't seem critically
important, and it got past that point after that (though I still can't
see anything special that would cause it to barf there and not with
the others...).
After that it gave assorted KCanvasMatrix errors in x_4 and iirc
x_10.cpp, things like incomplete type, invalid forward declaration of
struct KCanvasMatrix, etc., which was solved by manually #including
kcanvasmatrix.h into the x_*.cpp (why it wasn't there I don't know,
but love it when the easy solution actually works).
Building went fine from there, and I managed to construct a blank
QWidget + KCanvasView + KCanvas in Ruby. Looks like you were right
about having to write custom marshallers though :(, as it says it
can't handle a return type of KCPathDataList... but that'll have to
wait for tomorrow.

anyways, thanks for putting up with me =)

> 
> -- Richard
> 
> > (I removed the symlink and just straight copied the dir into kdelibs,
> > again to be paranoid about it, but apparently that wasn't the problem.
> > (And before you ask  (and I most certainly would ask, as it's not
> > unlikely I'm doing something similarly stupid ;), I'm not forgetting
> > to recompile korundum after changing stuff in smoke, nor to make
> > install.))
> >
> > On 6/23/05, Richard Dale <Richard_Dale at tipitina.demon.co.uk> wrote:
> > > 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 =
> > > "kio/|kdevelop/|kinterfacedesigner/|kontact/|kate/|kparts/|dom/|kabc/|kse
> > >ttings/|kjs/|ktexteditor/|kdeprint/|kdesu/|knewstuff/"
> > >
> > > 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
> 


-- 
Work is punishment for failing to procrastinate effectively.



More information about the Kde-bindings mailing list