SWT to libswt.a and binary size shrinking
Alexandr Karimov
karimchik@pisem.net
Wed May 12 08:18:00 GMT 2004
I'm new to GCJ and I'm only java programmer with small C++ experience.
I tried at first GCJ build from http://www.thisiscool.com/gcc_mingw.htm -
it goes with swt snapshot 3038. The compiled size for HelloSWT example was
near 3.5Mb and it works (with UPX packer I got the exe about 1Mb).
Then I installed the latest MinGW with GCC 3.3.4 candidate (May build) and
tried to build the new version of libswt.a from the latest SWT snapshot
(3050). Building from compiled classes generated some errors connected with
RTFTransfer, TextTransfer, ImageLoader and some ole-related classes.
Building from the source code generated error only with TableCursor.java,
but I added .o object through compiling not the TableCursor.java but
TableCursor.class, TableCursor1ドル.class etc. The result size of libswt.a is
about 8Mb.
Then I compiled the same HelloSWT example and got exe file with size about
6Mb (3.5Mb after UPX) + when run then get the next error:
Exception in thread "main" org.eclipse.swt.SWTException: Unsupported or
unrecognized format
at 0x004f732e (Unknown Source)
....
I think that this error is connected with gif image loading...
According to described above I have two questions:
1) What can be wrong with my libswt.a and how can I patch it to eliminate
the above Exception?
2) Why is there so huge size difference between two compiled exe files
(with http://www.thisiscool.com/gcc_mingw.htm and alone MinGW instance) and
how I can shrink the generated exe to the minimum possible size?
Regards, Alexandr
More information about the Java
mailing list