[818] in java-interest
native OpenGL
daemon@ATHENA.MIT.EDU (Duncan Swain)
Thu Jul 20 20:51:38 1995
Date: Thu, 20 Jul 1995 19:06:06 -0400
From: dswain@condor.citi.doc.ca (Duncan Swain)
To: java-interest@java.Eng.Sun.COM
I have been trying unsuccessfully to call native methods written in C which in turn make OpenGL library calls. As an example, consider the following code which is built (along with it's stub) into a dynamic library called libogltest.so: (this example works fine when the GL code is replaced with a simple printf() call)
#include "StubPreamble.h"
#include "javaString.h"
#include "project_OpenGLTest.h"
#include <GL/gl.h>
#include "aux.h"
void project_OpenGLTest_openWindow(struct Hproject_OpenGLTest *this)
{
auxInitDisplayMode (AUX_SINGLE | AUX_RGB);
auxInitPosition (0, 0, 500, 500);
auxInitWindow ("OGL test");
glClearColor (0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
sleep (10);
}
ld.so.1: /usr/ncis/hotjava/bin/sun4/java: fatal: relocation error: symbol not found: auxInitDisplayMode: referenced in /usr/ncis/MyApp/lib/libogltest.so
My java class looks like this: (libGL.so, libaux.so, and libogltest.so are in my LD_LIBRARY _PATH)
class OpenGLTest {
static {
Linker.loadLibrary("GL"); <<<<<???
Linker.loadLibrary("aux"); <<<<<???
Linker.loadLibrary("ogltest");
}
public native void openWindow();
}
How am I supposed to dynamically link to the GL libs?
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com