13 messages in net.java.dev.jna.users[jna-users] Error looking up function
FromSent OnAttachments
Peter SchwarzSep 5, 2008 12:47 pm 
Timothy WallSep 5, 2008 1:10 pm 
Peter SchwarzSep 5, 2008 1:14 pm 
Timothy WallSep 5, 2008 1:45 pm 
Peter SchwarzSep 5, 2008 1:56 pm 
Timothy WallSep 5, 2008 3:34 pm 
Peter SchwarzSep 5, 2008 4:25 pm 
Timothy WallSep 5, 2008 10:35 pm 
Peter SchwarzSep 8, 2008 10:43 am 
Timothy WallSep 10, 2008 9:58 am 
Timothy WallSep 10, 2008 10:02 am 
Timothy WallSep 10, 2008 10:07 am 
Peter SchwarzSep 10, 2008 1:45 pm 
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:[jna-users] Error looking up functionActions...
From:Peter Schwarz (psch@gemini.edu)
Date:Sep 5, 2008 12:47:40 pm
List:net.java.dev.jna.users

Hi,

I¹ve been using JNA to talk to the Python library on OS X 10.5. My particular library is located in /usr/lib, so I¹m not sure if this is the library that shipped with 10.5, or the one from MacPorts.

I haven¹t had any trouble hooking up to the methods that will start an interpreter, run scripts, or even fork threads, but when trying to add a module through the method Py_InitModule4 (the only one that is visible). If I run nm on the library I get the following info:

libpython.dylib:single module: 0008bf80 (__TEXT,__text) external _Py_InitModule4

Should this be visible to JNA?

When running my test I always get the following stack trace:

java.lang.UnsatisfiedLinkError: Error looking up function 'Py_InitModule4': dlsym(0x10011a510, Py_InitModule4): symbol not found at com.sun.jna.Function.<init>(Function.java:129) at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:232) at com.sun.jna.Library$Handler.invoke(Library.java:191) at $Proxy1.Py_InitModule4(Unknown Source) at edu.gemini.python.PythonService.addModule(PythonService.java:151) at edu.gemini.python.PythonExtensionTest.testSimpleModule(PythonExtensionTest.j ava:26) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)

It doesn¹t seem to matter if I change the number or type or args, etc., JNA can¹t find the method.

Cheers,