Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • Thank you very much for your answer. I'd like to try but i get this error when i load the dll... "java.lang.UnsatisfiedLinkError: Can't load IA 32-bit .dll on a AMD 64-bit platform" Commented Aug 5, 2011 at 16:38
  • i'm on Windows 7 64 bit but i'm using a 32-bit version of jdk Commented Aug 5, 2011 at 16:39
  • @Oneiros Then you have to link the DLL as a 32-bit DLL. (I can't help you there---my Windows machines all run 32-bit versions of Windows.) Commented Aug 5, 2011 at 16:48
  • ok i solved that problem... but now i have another one: java can load the dll file but it exit with this error: A fatal error has been detected by the Java Runtime Environment: EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10009a7d, pid=2264, tid=3856. This is how i implemented the native method: jintArray jResults = env->NewIntArray( tmp.size() ); env->SetIntArrayRegion( jResults, 0, tmp.size(), &tmp[0] ); return (jobjectArray)env->NewObjectArray(n, env->GetObjectClass(jResults), 0); Commented Aug 7, 2011 at 22:28
  • @Oneiros It looks like you've got a bad pointer somewhere, probably in the code which fills tmp from the returned int**. But your return statement doesn't make sense either: you don't want to return an Object[], but an int[]. Your return creates a new array of n references to int[], all initialized to null, and totally ignores the data returned by verts and the array you constructed from it. It's possible to do something like this to construct an int[][] to return to Java, but it's more complicated, and doesn't correspond to the code I posted. Commented Aug 8, 2011 at 7:55