14 messages in net.java.dev.jna.usersHello! JRuby, JNA, toString error
FromSent OnAttachments
Charles Oliver NutterAug 31, 2007 8:53 am 
Timothy WallAug 31, 2007 9:19 am 
Timothy WallAug 31, 2007 9:49 am 
Charles Oliver NutterAug 31, 2007 9:54 am 
Dennis PortelloAug 31, 2007 9:59 am 
Charles Oliver NutterAug 31, 2007 10:15 am 
Timothy WallAug 31, 2007 10:30 am 
Charles Oliver NutterAug 31, 2007 10:36 am 
Charles Oliver NutterAug 31, 2007 11:04 am 
Timothy WallAug 31, 2007 11:04 am 
Charles Oliver NutterSep 1, 2007 4:04 pm 
Dennis PortelloSep 1, 2007 7:25 pm 
Charles Oliver NutterSep 2, 2007 8:32 am 
Dennis PortelloSep 2, 2007 10:51 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Hello! JRuby, JNA, toString errorActions...
From:Charles Oliver Nutter (char@sun.com)
Date:Aug 31, 2007 8:53:05 am
List:net.java.dev.jna.users

Forgive if this issue has been addressed in the past. I didn't see it in a quick look through the archives.

I'm interested in using JNA within JRuby for two purposes:

- to call native libraries for functions that do not yet exist in the Java libraries (chown, fcntl, etc) - to provide a mechanism for loading C Ruby extensions

There's also a few native library implementations in the Ruby standard library I'd like to implement (DL, for general purpose dylib access; win32api for win32; gtk; tk; and on and on)

So I'm trying to get it up and working. The CLibrary example worked ok, but when I made my own (empty) interface and tried to Native.loadLibrary("libc.dylib", LibC.class) I got this:

irb(main):004:0> libc = Native.loadLibrary("libc.dylib", java.lang.Class.forName("LibC")) Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot locate function 'toString' at com.sun.jna.NativeLibrary.getFunctionAddress(NativeLibrary.java:197) at com.sun.jna.Function.<init>(Function.java:106) at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:184) at com.sun.jna.Library$Handler.invoke(Library.java:142) at $Proxy4.toString(Unknown Source) at org.jruby.javasupport.JavaObject.to_s(JavaObject.java:132)

Pointers?

- Charlie