Problem compiling apache libraries

Mohsen Saboorian mohsens@gmail.com
Fri Feb 9 15:44:00 GMT 2007


Thanks,

Using -fjni switch fixed almost 4/5 of those undefined reference
errors. Yet I have problems...

Main class is in a jar file called zekr.jar. I also compiled it into
zekr.o, so I assume there is no need to have -Izekr.jar (or any other
dependency jars, which are already available as .o) in --classpath.
Anyway, again compiling with this command line gives errors:
$gcj --main=ZekrMain -fjni -findirect -dispatch apache-commons.o
log4j-1.2.8.o swt-win32.o velocity-1.4.o velocity-tools-generic-1.2.o
zekr.o

It gives many errors of the form:
velocity-tools-generic-1.2.o: In function
`ZN3org6apache8velocity5tools7generic12IteratorTool12internalWrapEJv
PN4java4lang6ObjectE':
.../velocity-tools-generic-1.2.jar:(.text+0x3aa9): undefined reference
to `org::apache::velocity::util::ArrayIterator::class$'

although org.apache.velocity.util.ArrayIterator is available in velocity-1.4.o.
Any idea?

Many thanks.

On 2/9/07, Marco Trudel <mtrudel@gmx.ch> wrote:
> Andrew Haley wrote:
> > Mohsen Saboorian writes:
> >  > By compiling jar files into object files, I'll no more need to add
> >  > those jar files in classpath, right?
> >
> > Right.
>
> I'd say it depends on what you exactly do. If you only have jars, then
> you don't need them any longer. If you compile a java source together
> with the jar like:
>
> gcj -fjni --main=MyApp MyApp.java swt-win32.o [-Iswt-win32.jar]
>
> Then of course, you still need the jars in the classpath in order to
> allow ecj1 to compile MyApp.java.
>
> BTW Andrew: Good thinking with "-fjni"! Thats really one that likes to
> bring headaches and I think the best among us already spent at least a
> quarter of an hour searching the problem at another place :-(
>
>
> Marco
>



More information about the Java mailing list