This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: CLASSPATH problems
- To: Art Werschulz <agw at dsm dot fordham dot edu>
- Subject: Re: CLASSPATH problems
- From: Alexandre Petit-Bianco <apbianco at cygnus dot com>
- Date: Tue, 26 Jun 2001 10:45:06 -0700 (PDT)
- Cc: java at gcc dot gnu dot org
- References: <200106261641.f5QGfGd04001@sobolev.dsm.fordham.edu>
- Reply-To: apbianco at cygnus dot com
Art Werschulz writes:
> However:
> % gcj -c Foo.java
> % gcj -o Foo --main=Foo Foo.o
> Foo.o: In function `Foo::main(JArray<java::lang::String *> *)':
> /u/sobolev/agw/tmp/Foo.java:6: undefined reference to `_CL_3Bar'
> /u/sobolev/agw/tmp/Foo.java:6: undefined reference to `Bar::Bar(void)'
> /u/sobolev/agw/tmp/Foo.java:7: undefined reference to
> `Bar::writeln(java::lang::String *)'
> collect2: ld returned 1 exit status
>
> FWIW, I also did
> % gcj -c Bar.java
> within /u/sobolev/agw/java-classes, to see whether it would make a difference.
> It didn't.
You're almost there. You need to tell gcj about all the object files
that are required for your application to link properly. So
gcj -o Foo --main=Foo Foo.o /u/sovolec/agw/java-classes/Bar.o
will link your program.
./A