GCJ and OpenGL under Win32

Sal gcj@svf.dreamhost.com
Wed Jan 5 07:40:00 GMT 2005

I've been looking for a way to get GCJ and OpenGL to  work together 
under win32.  I've tried different OpenGL libs with GCJ and had little 
luck... jogl uses Swing stuff that chokes gcj, lwgl gives many 
compile/link errors, but SWT's experimental OpenGL seems to almost work.

I had problems building SWT 3.0.1, recieved some 'Validation failed' 
errors when I was compiling, but I managed to work around it by adding 
the SWT source to my project directly.  There seems to be some problem 
with compiling SWT 3.0.1 from its .jar file.  Also GCJ picked up some 
errors in the SWT source that Sun's compiler must have missed (a method 
was overridden with the wrong return value).

After that I tried to build the 'experimental' OpenGL library for SWT.  
I had to build it from source also, recieved errors trying to build it 
from the jar file. 

All seems to work fine with SWT and OpenGL, my test application compiles 
and links. But when I run my application I get:

Exception in thread "main" java.lang.UnsatisfiedLinkError: gluPerspective
   at 0x00651ffe (Unknown Source)
   at 0x006519d2 (Unknown Source)
   at 0x00652944 (Unknown Source)
   [... repeat long traceback here...]

I've put the gl-win32.dll in the executable directory, along with the 
SWT dll.  I've also tried modifying my makefile to link with libglu32 & 
libopengl32 that come with mingw32. (using -llibglu32 etc.)  But 
continue to recieve the 'UnsatisfiedLinkError' at runtime.  Can anyone 
give some advice on this?

If anyone has been able to get an OpenGL implementation to work under 
GCJ I would be interested in hearing about it, also!

Thanks much in advance,

- Sal

More information about the Java mailing list