This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
gcj compilation
- From: Fx Mx <lard_power at yahoo dot com>
- To: java at gcc dot gnu dot org
- Date: Sat, 24 Jan 2004 17:46:29 -0800 (PST)
- Subject: gcj compilation
Hello everyone:
i've been programming Java for a while but i'm having
the following problem migrating to gcj.
I wrote the following "simplest possible" code to
demonstrate what's going on...
::::::::::::::
thing.java
::::::::::::::
import java.io.*;
import beasts.Animal;
public class thing {
public static void main(String[] args) {
Animal.FreakOut();
}
}
::::::::::::::
beasts/Animal.java
::::::::::::::
package beasts;
import java.io.*;
public class Animal {
public static void FreakOut() {
System.out.println("BLEAGH!");
}
}
and here is the error message:
bash-2.05b$ gcj --main=thing thing.java
/tmp/cceHFZpD.o(.text+0x13): In function
`thing::main(JArray<java::lang::String*>*)':
: undefined reference to `beasts::Animal::FreakOut()'
collect2: ld returned 1 exit status
even though javac and java run it fine:
bash-2.05b$ java thing
BLEAGH!
I've looked through the FAQ, docs, and I just dont see
what's going on... the crazy thing is that if I say
something like Animal.TweakOut() which is actually not
defined, i get:
bash-2.05b$ gcj --main=thing thing.java
thing.java: In class `thing':
thing.java: In method
`thing.main(java.lang.String[])':
thing.java:6: error: Can't find method `TweakOut()' in
type `beasts.Animal'.
Animal.TweakOut();
^
thanks in advance!
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/