This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: newbie linker question


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]