bodensx / jnaerator

Automatically exported from code.google.com/p/jnaerator
0 stars 0 forks source link

Direct mode does not work with pointer to pointer to const char #73

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Declare a function prototype as
extern void myfunc(const char **s);
2. Write definition and compile shared library
3. Use -direct flag to generate bindings
4. Use method in java

What is the expected output? What do you see instead?

Exception in thread "main" java.lang.ExceptionInInitializerError
        at testexj.main(testexj.java:15)
Caused by: java.lang.IllegalArgumentException: class [Ljava.lang.String; is not 
a supported argument type (in method exfnb in class exj.ExLibrary)
        at com.sun.jna.Native.register(Native.java:1290)
        at com.sun.jna.Native.register(Native.java:1018)
        at exj.ExLibrary.<clinit>(ExLibrary.java:21)

What version of the product are you using? On what operating system?

0.9.5 on Linux (RHEL5)

Is the problem still present in the latest SVN version ? (you can easily
build from sources with these instructions :
http://code.google.com/p/javacl/wiki/Build)

Do not know as can not access repo from site

Please provide any additional information below.

I can provide trivial source code if needed

Original issue reported on code.google.com by pcyc...@gmail.com on 3 Nov 2010 at 1:20

GoogleCodeExporter commented 8 years ago
Hello,

Sorry for the late reply, missed the notification email :-S
This is a limitation of JNA's direct mode, which you should complain about on 
JNA's users mailing list directly (I don't support JNA).
Please note that BridJ (which I do support) does not have such a limitation 
(although it has other limitations), be sure to check it out :
http://code.google.com/p/bridj/

Cheers
--
Olivier

Original comment by olivier.chafik@gmail.com on 30 Nov 2010 at 5:20

GoogleCodeExporter commented 8 years ago
Hi,

Thanks for your reply. I thought I was using BridJ though through
JNAerator. Never mind, I stuck to swig to do the job.

Original comment by pcyc...@gmail.com on 9 Dec 2010 at 11:53

GoogleCodeExporter commented 8 years ago
By default, JNAerator creates bindings for JNA, but using the `-runtime BridJ` 
switch targets BridJ.

Hope you'll have a chance to give BridJ a try for another project ;-)

Cheers
--
Olivier

Original comment by olivier.chafik@gmail.com on 10 Dec 2010 at 12:10