newbie linker question
Tom Tromey
tromey@redhat.com
Fri Oct 18 12:41:00 GMT 2002
>>>>> "Myriam" == Myriam Abramson <mabramso@gmu.edu> writes:
Myriam> But when I try to compile a java class referring to other java
Myriam> classes in the same directory I get a linker error:
Myriam> gcj3 --main=package.Main -o Main Main.java
Myriam> gives me "Undefined reference to package::Utils.class"
Myriam> What am I missing?
You have to compile package.Utils and link it into the executable.
It's perhaps easier if you think about it like building a C program,
not building a Java program. First you compile everything to .o.
Then you link the .o files together to make the executable.
Tom
More information about the Java
mailing list