newbie: compiling/linking
Jeff Sturm
jsturm@one-point.com
Sat Dec 14 08:10:00 GMT 2002
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
More information about the Java
mailing list