This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: SWT 3 and gcj
Hi,
it works for me. Perhaps you have to put swt-awt-win32-3024.dll into the
dir, too? I really don't know what it contains...
Here how I did it:
I used Mohans latest binary gcc-3.4 build.
There I created the dir
thisiscool/swt/win32/swt-3024/
and copied swt-win32-3024.dll, swt-awt-win32-3024.dll, swt.jar and SwtImageLoaders.java
there. (ImageLoaders from ../swt-2133)
I changed the scripts (thisiscool/swt/win32/scripts):
build.bat:
adapted PATH to point to msys bin dir
build.sh:
changed swt version to 3024
added commands for copying swt-awt-win32-3024.dll in the same way swt-win32-3024.dll is copied
(you can also copy this manually of course)
ran build.bat
Important: As in my case gcj fails to compile the org.eclipse.swt.graphics.ImageLoader class
I did this manually while gcj was building the other files.
Extract ImageLoader.java from swtsrc.zip. Run
gcj -fjni -g0 -c -o org_eclipse_swt_graphics_ImageLoader.o ImageLoader.java
(worked without errors fine for me)
Wait for the build.bat-buildprocess to finish.
It rocks. My program which I finally got working under win32-gcj also works with the new swt.
Peschmä
Am Tue, 14 Oct 2003 19:19:02 +0200 schrieb Simon Rutishauser:
> I'll give it a run. Just need to fetch it...
>
> Peschmä
>
> Am Tue, 14 Oct 2003 01:02:06 -0400 schrieb Rutger Ovidius:
>> Has anyone had success with SWT 3 and gcj?
>>
>> Since SWT 2 has so many bugs, I would like to compile my application
>> with SWT 3. I am attempting this on windows.
>>
>> Eclipse Milestone 4 was recently released. SWT 3 from Milestone 4 is
>> what I am using. (www.eclipse.org)
>>
>> With gcj 3.3.1, I get many verification problems when trying to compile
>> from the SWT.jar file (.class files). When compiling from the source
>> .java files, I eventually succeed in building a libswt.a file, if I
>> remove some of the source files from the CLASSPATH and compile them from
>> outside of the CLASSPATH. (I'm still not sure why this is necessary)
>>
>> With the thisiscool 3.4 build: (gcc version 3.4 20031006
>> (experimental)), I get
>> less errors when compiling from .java source (only 2), but seemingly
>> more fatal:
>>
>> ./org/eclipse/swt/custom/StyledText.java:162: internal compiler error:
>> tree check: expected class 'd', have 'x' (error_mark) in
>> make_nested_class_name, at java/parse.y:3484
>>
>> But, moving this file outside of the CLASSPATH and compiling it from
>> there seems to work.
>>
>> I use the build.sh from the thisiscool package for SWT building.
>>
>> (gcj -fjni -c -o <all java files>, ar -rcs *.o libswt.a, ranlib
>> libswt.a)
>>
>> Once I create my libswt.a, I link my test app to it just as I do with
>> SWT2. My SWT2 libswt.a works fine, but nothing I try with SWT3 will
>> work. Getting a simple Display fails. (The swt-win32-3024.dll is in the
>> same directory and is not the problem).
>>
>> Exception in thread "main" java.lang.NullPointerException
>> at __GLOBAL__I__ZN4Main4mainEP6JArrayIPN4java4lang6StringEE
>> (F:\testswt\Main.java:1)
>>
>> When I compile with "javac" and "java" run it, it works just fine with
>> SWT3. Please let me know if you have had success with SWT3 and gcj.
>> Thanks.
>>
>> ---
>>
>> public class Main {
>> public static void main( String[] args ) {
>> Display display = new Display( );
>> Shell shell = new Shell( display );
>> shell.setLayout( new FillLayout( ) ); shell.open( ); while (
>> !shell.isDisposed( ) ) {
>> if ( !display.readAndDispatch( ) ) {
>> display.sleep( );
>> }
>> }
>> }
>> }
>> }
>> }