[Kde-java] Using GCJ with KDE Java

Richard Dale Richard_Dale at tipitina.demon.co.uk
Tue Mar 2 09:19:51 CET 2004


On Monday 01 March 2004 21:59, George Russell wrote:
> I've tried using GCJ to compile a KDEJava application, but I get link
> time errors.
>
> First, I'd like to know if anyone has successfully compiled a KDE Java
> application using GCJ?
Yes, it works very well, but the two extra libraries (lib-org-kde-qt.so and 
lib-org-kde-koala.so) you need aren't built by default at the moment, because 
of problems with the KDE build system. Adrian Petru Dimulescu asked the same 
question on comp.windows.x.kde recently, and I've copied my reply to that 
below. If you can try the AM_PROG_GCJ macro and see if it generates a working 
libtool with GCJ tag. Otherwise, the work round would be to build the libs 
using ordinary make commands, rather than automake.

-- Richard

> Secondly, is there a magic incantation to get the two to work togther?
> The native libraries are on the LD_LIBRARY_PATH
> export CLASSPATH =
> $CLASSPATH:/sw/lib/java/qtjava.jar:/sw/lib/java/koala.jar
>
> gcj -L/sw/lib --main=Main *.java
>
> The error messages are below.
>
> /usr/bin/ld: Undefined symbols:
> org::kde::qt::QPopupMenu::class$

Richard Dale replied to Adrian Petru Dimulescu:

I haven't been able to build a gcj interface library for the qtjava/kdejava
libs because I can't get the AM_PROG_GCJ macro in configure.in.in to
correctly generate a libtool with a GCJ tag. It might be some problem
specific to my Linux installation though.

It should be a matter of adding a AM_PROG_GCJ macro to 
kdebindings/configure.in.in:

dnl
dnl Java checks
dnl

AM_PROG_GCJ

Then add these lines to the end of qtjava/javalib/org/kde/qt/Makefile.am:

GCJFLAGS=-fjni
lib_LTLIBRARIES = lib-org-kde-qt.la
lib_org_kde_qt_la_SOURCES = $(EXTRA_DIST)

And these lines to the end of kdejava/koala/org/kde/koala/Makefile.am:

GCJFLAGS=-fjni
lib_LTLIBRARIES = lib-org-kde-koala.la
lib_org_kde_koala_la_SOURCES = $(EXTRA_DIST)

..and configure kdebindings.

But then it doesn't work for me :( !

It should build and install lib-org-kde-qt.so and lib-org-kde-koala.so which
you could link to when compiling with gcj.

-- Richard


More information about the Kde-java mailing list