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: 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


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