There's something i'm confused about.

Julia Smith julias@macrovision.com
Tue Mar 4 21:52:00 GMT 2003


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?
well, if I type
gcj -c someclass.java and it produces a .o 
file reports its ELF 32 relocatable unstripped.
then i try
ar qv myarchivename.a someclass.o
and it bitches about unknown object format. the archive is a non existing file.
i may be fairly rusty dealing with ar. its been a while.
>>>>>> 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.
^^^^^^^^^^^^^
Fine. Its not documented. I am using gcj 3.2.2. There is no information on these options in the man pages. Does this option work for jar files?
Until I can archive .o's this isn't an option unless the linker accepts .jars


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /