Problem compiling apache libraries
Mohsen Saboorian
mohsens@gmail.com
Fri Feb 9 12:29:00 GMT 2007
Thanks for the reply.
I could compile those libs with that option.
By compiling jar files into object files, I'll no more need to add
those jar files in classpath, right?
Now, I want to compile the whole project into a single executable
file. I use the following commang line:
gcj --main=MainClass -findirect-dispatch apache-commons.o
log4j-1.2.8.o swt-win32.o velocity-tools-generic-1.2.o velocity-1.4.o
zekr.o
where all the needed runtime jars added as .o file, but GCJ gives a
lot of error messages complaining "undefined reference to
XYZ::class$$'"
e.g.
swt-win32.jar:(.data+0x2f110): undefined reference to `_ZN
3org7eclipse3swt8internal8Callback4bindEJiPS3_PN4java4lang6ObjectEPNS6_6StringESA_ibbi'
Is there any trick to bypass these reference errors?
Thanks.
On 2/9/07, Marco Trudel <mtrudel@gmx.ch> wrote:
> Mohsen Saboorian wrote:
> > Hi,
> >
> > I'm trying to compile a project into native form using GCJ. The
> > project depends on some of apache commons libraries plus velocity and
> > log4j. I was able to compile log4j (1.2.8) into .obj format, by
> > removing package: org.apache.log4j.jmx. Unfortunately I cannot compile
> > Velocity 1.4, because of it's referencing to many other packages
> > (still unused):
> > - org.apache.velocity.anakia.* to JDOM
> > - org.apache.velocity.convert.WebMacro to ant
> > - ...
> >
> > Is it possible to compile libraries like Velocity, ignoring unused
> > library references?
>> Compiling with the "-findirect-dispatch" flag will do that.
>> > Is there any place to download already natively-compiled apache libraries?
>> Not that I know of... IMHO, it wouldn't make sense anyway.
>>> Marco
>
More information about the Java
mailing list