Re: Problems getting started with gluten
Posted by Jennifer Milburn on Jan 22, 2012; 10:29pm
URL: https://forum.jogamp.org/Problems-getting-started-with-gluten-tp3679814p3680428.html
Thanks Wade,
I had ant-antlr.jar on the class path (i.e. in the same directory) but I guess it was looking for antlr.jar. Your suggestion helped and I was able to generate the source code for one of the examples! It appears that I can generate the JNI code for simple examples now. I just tried generating the JNI code for the actual header file I need to work with and got a variety of errors. However, it's clear that the gluegen is at least attempting to generate the JNI code.
I'm just trying to test the generation process on MacOS so I don't really expect this to work completely. I'm going to generate different JNI classes for Windows and Linux using their respective header files (i.e. slightly different header for the two operating systems). However, I am getting a large number of errors mostly related to ANTLR running into an unexpected token
"extern" in the header.
ANTLR Parsing Error: line 122:4919: unexpected token: extern token name:"extern"
line 122:4919: unexpected token: extern
at com.jogamp.gluegen.cgram.GnuCParser.externalDef(GnuCParser.java:522)
at com.jogamp.gluegen.cgram.GnuCParser.externalList(GnuCParser.java:258)
at com.jogamp.gluegen.cgram.GnuCParser.translationUnit(GnuCParser.java:219)
at com.jogamp.gluegen.GlueGen.run(GlueGen.java:131)
at com.jogamp.gluegen.GlueGen.main(GlueGen.java:363)
(note there are about 30 of these errors)
I'm also getting the following error that is a little more serious. Is this related to a limitation of JNI for this kind of method (i.e. a callback reference?)
Exception in thread "main" java.lang.RuntimeException: Exception occurred while generating glue code.
at com.jogamp.gluegen.GlueGen.run(GlueGen.java:304)
at com.jogamp.gluegen.GlueGen.main(GlueGen.java:363)
Caused by: java.lang.RuntimeException: Error while generating bindings for "int AT_RegisterFeatureCallback(AT_H Hndl, const AT_WC * Feature, int (*EvCallback)(AT_H Hndl, const AT_WC * Feature, void * Context), void * Context);"
at com.jogamp.gluegen.JavaEmitter.generateMethodBindingEmitters(JavaEmitter.java:726)
at com.jogamp.gluegen.JavaEmitter.emitFunctions(JavaEmitter.java:419)
at com.jogamp.gluegen.GlueGen.run(GlueGen.java:297)
... 1 more
Caused by: java.lang.RuntimeException: Don't know how to convert pointer/array type "FeatureCallback"
at com.jogamp.gluegen.JavaEmitter.typeToJavaType(JavaEmitter.java:1292)
at com.jogamp.gluegen.JavaEmitter.bindFunction(JavaEmitter.java:1717)
at com.jogamp.gluegen.JavaEmitter.generateMethodBindingEmitters(JavaEmitter.java:651)
... 3 more
Any insight would be appreciated :) I don't have any control over the header or the C interface. I'm simply trying to create a java interface to the cameras drivers for Linux and Windows and the drivers are provided by the manufacturer.
Sincerely,
Jennifer Milburn