This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: compiling with gcj
- From: Tom Tromey <tromey at redhat dot com>
- To: Adam Satcowitz <adam at planbtechnologies dot com>
- Cc: java at gcc dot gnu dot org
- Date: 12 Mar 2003 23:42:01 -0700
- Subject: Re: compiling with gcj
- References: <4.3.2.7.2.20030313001955.00e08660@imap1.panix.com>
- Reply-to: tromey at redhat dot com
>>>>> "Adam" == Adam Satcowitz <adam at planbtechnologies dot com> writes:
Adam> i type: gcj --main=SendMailMessage
Adam> d:\inetpub\classes\com\planbtechnologies\SendMailMessage.java
Adam> i get:
Adam> C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccqKaaaa.o: In function
Adam> `ZN15SendMailMessage4mainEP6JArrayIPN4java4lang6StringEE':
Adam> d:/inetpub/classes/com/planbtechnologies/SendMailMessage.java:32:
Adam> undefined reference to `com::planbtechnologies::TextTools
Adam> ::parseOnString(java::lang::String*, java::lang::String*,
Adam> java::lang::String*, bool)'
With gcj, all the dependencies of your program must be compiled and
linked into the program. In the above, you are only compiling
SendMailMessage.java. But you also need to compile TextTools.java and
link it in.
Try:
gcj -c .../SendMailMessage.java
gcj -c .../TextTools.java
gcj --main=com.planbtechnologies.SendMailMessage *.o
Note that the argument to --main is the fully-qualified class name.
Tom