CLASSPATH problems
Alexandre Petit-Bianco
apbianco@cygnus.com
Tue Jun 26 10:45:00 GMT 2001
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
More information about the Java
mailing list