

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
13 messages in net.java.dev.jna.usersRe: [jna-users] Error looking up func...| From | Sent On | Attachments |
|---|---|---|
| Peter Schwarz | Sep 5, 2008 12:47 pm | |
| Timothy Wall | Sep 5, 2008 1:10 pm | |
| Peter Schwarz | Sep 5, 2008 1:14 pm | |
| Timothy Wall | Sep 5, 2008 1:45 pm | |
| Peter Schwarz | Sep 5, 2008 1:56 pm | |
| Timothy Wall | Sep 5, 2008 3:34 pm | |
| Peter Schwarz | Sep 5, 2008 4:25 pm | |
| Timothy Wall | Sep 5, 2008 10:35 pm | |
| Peter Schwarz | Sep 8, 2008 10:43 am | |
| Timothy Wall | Sep 10, 2008 9:58 am | |
| Timothy Wall | Sep 10, 2008 10:02 am | |
| Timothy Wall | Sep 10, 2008 10:07 am | |
| Peter Schwarz | Sep 10, 2008 1:45 pm |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: [jna-users] Error looking up function | Actions... |
|---|---|---|
| From: | Timothy Wall (twal...@dev.java.net) | |
| Date: | Sep 10, 2008 10:07:52 am | |
| List: | net.java.dev.jna.users | |
Try "Py_InitModule4_64", and use the "-arch" flag when using "nm".
You can use an invocation mapper to automatically call the right internal function from the Py_InitModule interface function, you you can just define both and call the right one depending on the architecture.
On Sep 8, 2008, at 1:43 PM, Peter Schwarz wrote:
It seems more like missing methods, rather than an environment thing. I've double checked the location, and I can access other methods out of the library. Here's my modified test:
public void testSanity() throws Exception { final NativeLibrary lib = NativeLibrary.getInstance("python");
assertEquals("/usr/lib/libpython.dylib", lib.getFile().getPath());
Function fn = lib.getFunction("Py_Initialize"); assertNotNull(fn);
fn = lib.getFunction("Py_InitModule"); assertNotNull(fn); }
The only assertion that fails is that last one.
Cheers,
Peter
On 9/5/08 7:35 PM, "Timothy Wall" <twal...@dev.java.net> wrote:
yeah, that works for me, so it must be an environmental or library issue.
lrwxr-xr-x 1 root wheel 16 Oct 26 2007 /usr/lib/libpython.dylib -> libpython2.dylib lrwxr-xr-x 1 root wheel 16 Oct 26 2007 /usr/lib/ libpython2.5.dylib -> libpython2.dylib lrwxr-xr-x 1 root wheel 68 Oct 26 2007 /usr/lib/ libpython2.dylib -
../../System/Library/Frameworks/Python.framework/Versions/2.5/Python
On Sep 5, 2008, at 7:25 PM, Peter Schwarz wrote:
I tried it the beanshell way, and I wasn't able to import the jna lib, so instead, I wrote the following unit test:
public class NativeLibraryTests extends TestCase { public void testSanity() throws Exception { final NativeLibrary lib = NativeLibrary.getInstance("python"); final Function fn = lib.getFunction("Py_InitModule4"); assertNotNull(fn); } }
I still get the following result:
java.lang.UnsatisfiedLinkError: Error looking up function 'Py_InitModule4': dlsym(0x10011a4d0, 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.NativeLibrary.getFunction(NativeLibrary.java:210) at edu .gemini .python.nativelib.NativeLibraryTests.testSanity(NativeLibraryTests .java:13) 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)







