[Kde-bindings] Trouble with current smoke and old 'Hello World' program

Chris Burel chrisburel at gmail.com
Wed Jul 2 07:49:55 UTC 2008


I'm interested in doing some work on getting smoke2-based perl bindings for
Qt4.  To get my feet wet, I grabbed the 'hello.c' file mentioned in this
post:
http://lists.kde.org/?l=kde-bindings&m=112890653817358

I can get it to compile when I use the smoke.h from Perl-Qt3, but I can't
get it to work with the current svn snapshot, which for the record is
827027.

>g++ -g -I$QTDIR/include -I/home/chris/src/kdebindings/smoke -o hellosmoke2
hellosmoke2.c -lqt-mt
hellosmoke2.c: In function 'short int getMethod(Smoke*, const char*, const
char*)':
hellosmoke2.c:53: error: cannot convert 'Smoke::ModuleIndex' to 'short int'
in initialization
hellosmoke2.c: In function 'void smokeCast(Smoke*, short int,
Smoke::StackItem*, short int, void*, const char*)':
hellosmoke2.c:79: error: no matching function for call to
'Smoke::cast(void*&, Smoke::ModuleIndex, short int&)'
/home/chris/src/kdebindings/smoke/smoke.h:311: note: candidates are: void*
Smoke::cast(void*, short int, short int)
hellosmoke2.c: In function 'void smokeCastThis(Smoke*, short int,
Smoke::StackItem*, void*, const char*)':
hellosmoke2.c:85: error: no matching function for call to
'Smoke::cast(void*&, Smoke::ModuleIndex, short int&)'
/home/chris/src/kdebindings/smoke/smoke.h:311: note: candidates are: void*
Smoke::cast(void*, short int, short int)

I took a look at how the smoke.h had changed, and discovered that the
Smoke::ModuleIndex is just a struct, that contains the index.  So I changed
the lines to get the index from the ModuleIndex struct:
53c53
<     Smoke::Index method = smoke->findMethod(c, m);
---
>     Smoke::Index method = smoke->findMethod(c, m).index;
79c79
<     args[i].s_class = smoke->cast(obj, smoke->idClass(className),
smoke->types[arg].classId);
---
>     args[i].s_class = smoke->cast(obj, smoke->idClass(className).index,
smoke->types[arg].classId);
85c85
<     args[0].s_class = smoke->cast(obj, smoke->idClass(className),
smoke->methods[method].classId);
---
>     args[0].s_class = smoke->cast(obj, smoke->idClass(className).index,
smoke->methods[method].classId);


Now it compiles, but fails to link properly:
>g++ -g -I$QTDIR/include -I/home/chris/src/kdebindings/smoke -o hellosmoke2
hellosmoke2.c -lqt-mt
/tmp/ccQyDQ6w.o: In function `Smoke::findClass(char const*)':
/home/chris/src/kdebindings/smoke/smoke.h:376: undefined reference to
`Smoke::classMap'
/tmp/ccQyDQ6w.o: In function `Smoke::findMethodName(char const*, char
const*)':
/home/chris/src/kdebindings/smoke/smoke.h:412: undefined reference to
`Smoke::classMap'
/tmp/ccQyDQ6w.o: In function `Smoke::findMethod(Smoke::ModuleIndex,
Smoke::ModuleIndex)':
/home/chris/src/kdebindings/smoke/smoke.h:451: undefined reference to
`Smoke::classMap'
collect2: ld returned 1 exit status

I've actually got a really simple class that just has a few properties and
methods that I'm testing out smoke on, that has the same errors.  I used the
current snapshot to run kalyptus on my header file to give me smoke code, to
compile my own smoke .so.  Getting the smoke .so file works fine, it's just
this example of how to call the functions in the .so that I can't get to
work.
I'm stumped.  Could someone help?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20080702/cc1a71f5/attachment.html>


More information about the Kde-bindings mailing list