This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: newbie: compiling/linking
- From: Jeff Sturm <jsturm at one-point dot com>
- To: Dhek Bhun Kho <bhun at chello dot nl>
- Cc: java at gcc dot gnu dot org
- Date: Sat, 14 Dec 2002 11:10:19 -0500 (EST)
- Subject: Re: newbie: compiling/linking
On 14 Dec 2002, Dhek Bhun Kho wrote:
> If I compile ant using this (in the directory with all the libs):
>
> gcj --main=org.apache.tools.ant.Main -o ant lib-org-apache-tools.so
> lib-org-apache-bcel.so lib-javax-xml-transform.so
> lib-javax-xml-parsers.so lib-org-apache-regexp.so
> lib-org-apache-xerces.so lib-org-w3c-dom.so lib-org-apache-xml.so
> lib-org-apache-xalan.so lib-org-apache-xpath.so lib-java_cup.so
>
> Then I will get the duplicate class problem.
Here you linked org.w3c.dom classes, which are duplicated in libgcj...
> If I use this (int the same lib directory):
> gcj -o ant -L. -l-javax-xml-parsers --main=org.apache.tools.ant.Main
> -l-org-apache-tools -l-org-apache-bcel -l-javax-xml-transform
> -l-org-apache-regexp
...and here you didn't. Aside from the obvious differences, the two
commands are probably equivalent.
Once linked, "ldd ant" will tell you exactly which DSO's are included in
each.
Jeff