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: There's something i'm confused about.


>>>>>> If I compile a .class or .java to a .o, how come ar cannot accept the
file generated?
>>>>>> Why does ar (a gnu one at that) not take the default output of gcc or
any of its variants?

I'm wondering if this is truly so? I use "ar" all the time, with gcj-, gcc-,
and even vc.net produced .o files; and it works, no sweat, both on minGW as
on linux. What options did you use with "ar" and what files were you trying
to join in an archive?

>>>>>> I *still* get numerous linker errors declaring that
<some-class-in-one-of-the-jars> is undefined.

Be careful with linking. "ld" traverses the libraries to link only one time
(I used to have this problem as well: lots of unresolved symbols). The
solution is to create linking groups to be traversed multiple times until
all symbols are resolved:

gcj -Xlinker --start-group ${arc1} ${arc2} -Xlinker --end-group -o
${outexe} --main=${mainclass}

The "-Xlinker --start-group ... --end-group" did the trick in my case.



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