This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: problems with subclass
- From: Per Bothner <per at bothner dot com>
- To: "Marcelo D. RÃ" <mdre at rectorado dot unl dot edu dot ar>
- Cc: kawa at sources dot redhat dot com
- Date: Thu, 27 Mar 2008 11:48:24 -0700
- Subject: Re: problems with subclass
- References: <47EBB8B5.3000303@rectorado.unl.edu.ar>
Marcelo D. RÃ wrote:
I'm trying to subclass a Java class but it doesn't work correctly.
....
Exception in thread "main" java.lang.NoSuchFieldError: Lit0
at colony.FunctionalAntQueen.<init>(FunctionalAntQueen.scm:8)
The problem is probably because the FunctionalAntQueen class is not
self-contained, but depends on the enclosing "module class", which
contains top-level definitions (none in this case, except the
FunctionalAntQueen) and compiler-generated members such as literals.
You probably want to compile using the flag --module-static-run
command-line option, or (equivalently) put (module-static 'init-run)
in your file. See
http://www.gnu.org/software/kawa/Compilation-options.html
http://www.gnu.org/software/kawa/Module-classes.html#id2600899
It looks like things are further messed up because the name of the
module class is the same as the define-simple-class. Kawa doesn't
handle this well. (I vaguely remember putting in a test for this
in SVN Kawa, but I'm not sure.)
You could try putting something like
(module-name FunctionalAntQueenModule)
in your .scm file.
--
--Per Bothner
per@bothner.com http://per.bothner.com/