adding external library with JNI interface

Hello there!

I'm currently having difficulty using an external library with a JNI interface with Processing. The tricky thing is that it requires some external libraries as well. Currently I'm trying in windows, and have it working in a java project in eclipse. When I export the jar and try to use it in processing, I get:

A library relies on native code that's not available. Or only works properly when the sketch is run as a 64-bit application.

Digging further into it, it seems like the code that attempts to load the JNI library (System.loadLibrary(...)) call is what triggers this message - It happens if I try to use it, regardless of what's actually in it (like if I put in a bogus file name, it returns the same error). And if I switch to the 64 bit version, I get the error with 32-bit instead :). The external dll's are currently residing in the same folder as the .jar file in the libraries directory.

Any pointers would be greatly appreciated. I think the path/way I include the external library is mostly correct. If I try to run other things in an external library that doesn't require System.load... , it appears to work fine.

Thanks in advance!

Answers

  • update: If anyone cares, I managed to get it to work by importing the processing library into Eclipse, and running it from there.

  • Hi, I don't know if this helps, but Processing expects by default any native lib for your library to be located inside library/macosx, library/macosx32, library/macosx64, etc. (depending on the OS).

Sign In or Register to comment.