[Kde-bindings] I need help with SMOKE (trying to write bindings for SPL)

Ashley Winters jahqueel at yahoo.com
Mon Oct 10 01:08:18 UTC 2005


--- Clifford Wolf <clifford at clifford.at> wrote:
> Hi,
> 
> I'm trying to write Qt+KDE bindings for SPL
> (http://www.clifford.at/spl/)
> using SMOKE. My idea was to first write a little C program which only
> implemnts those parst of the iterface required for a little "Hello
> World"
> program, than make it an SPL module and finally add the missing code
> for
> the bindings to be complete.
> 

[...]

> I think with this two informations I should be able to write a small
> app
> which does the following with the SMOKE wrapper library:
> 
> 	#include <qt3/qapplication.h>
> 	#include <qt3/qlabel.h>
> 
> 	int main(int argc, char **argv)
> 	{
> 		QApplication *a = new QApplication(argc, argv);
> 		QWidget *l = new QLabel("Hello World!", NULL);
> 		a->setMainWidget(l);
> 		l->show();
> 		a->exec();
> 		return 0;
> 	}

I attached a working version of that program using Smoke. It's written
so that you don't link directly to -lsmokeqt, but dlopen() it. Ideally,
that would be portable, but the init() function isn't declared as
extern "C". The portable way is to link with -lsmokeqt directly, but I
don't really like that. Oh well. If Richard can patch Smoke with a new
version of the init() function, that'd be nifty:

extern void init_qt_Smoke();
extern "C" init_libsmokeqt() { init_qt_Smoke(); }

Compile with:
g++ -g -o hello hello.c -lqt-mt

and make sure you have libsmokeqt installed where it can be found --
either in your default lib path, or by setting LD_LIBRARY_PATH

Cheers,
Ashley Winters


	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hello.c
Type: text/x-csrc
Size: 5022 bytes
Desc: 3578776425-hello.c
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20051009/639afa82/attachment.c>


More information about the Kde-bindings mailing list