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]

Re: CLASSPATH problems



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


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