This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc/gcj 3.4 - bug report


>>>>> ">" == rezaei  <rezaei@promail.com> writes:

>> My build command is:
>> gcj -v --main=net.sourceforge.swtsolitaire.SwtMain --
>> classpath=%SWT_JAVA_LIB_DIR%\swt.jar -s -o test.exe jars\commons-
>> collections.jar jars\commons-logging-api-nojdk14.jar jars\jui-0.10m.jar 
>> jars\test.jar %SWT_GCJ_LIB_DIR%\SWTMessages.o -
>> L%SWT_GCJ_LIB_DIR% -lswt 

>> Somehow, -lswt ends up before SWTMessages.o and ld won't recognize
>> it.

It's usually better to build to .o and then link as a separate step.
The above is probably a bug -- feel free to put it in bugzilla.
(Preferably with the full -v output...)  Still, this will be low
priority, I think.

Try:

gcj ... -fPIC -shared -o collections.so .../collections.jar
[ repeat for each .jar ]
gcj --main=... -o test.exe collections.so ...other .so files... -lswt

That's on Linux anyway.  On Windows you may need to do compile to an
ordinary .o (I don't use Windows...).

>> 2) I've attached a very simple (15 line) swt program that works
>> fine with java.exe, but fails when compiled to native code. The bug
>> has to do with image loading. I think this is pretty much a show
>> stopper for any application.

Probably this is a static linking problem.  I'm not sure, since I
haven't tried your program.  But make sure that the image loaders are
in fact linked into your final executable.  Search this list's
archives for lots of talk about the problems of static linking, most
likely including discussions about this exact problem involving SWT.

>> Exception in thread "Thread-1" java.awt.AWTError: Cannot load AWT toolkit:

AWT isn't available yet.  I'm surprised that an SWT application would
try to use it.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]