LabyMod / opus-jni

Simple Java Opus library
GNU General Public License v3.0
37 stars 10 forks source link

How can i properly build it to be used in Processing pde project #5

Open medamarko opened 3 years ago

medamarko commented 3 years ago

Hi all, Im new to java world, and i wanted to use this nice simple lib wihtint processing 4.0 project. So what i did was followed building process and copied .dll and .jar files into lib folder of processing. So my project can load and see params from jar file it seems. Nevertheless issue appear when i try to run it say "A library relies on native code that's not available. Or only works properly when the sketch is run as a 32-bit application."

It looks like that it didnt linked dll properly. Do i need to change something in building steps to make jar+dll portable ?

Thanks!

jan-br commented 3 years ago

Hi, I am not that familiar with the Processing IDE, so I am not sure if there are any special things to consider when adding native dependencies. But in general Java everything should work just fine. Also you probably don't need to extract the native binaries manually. There are a few quite undocumented methods that can extract them for you in the right place. Maybe take a look at them here and execute either setupWithTemporaryFolder or manually extractNatives and loadNatives at program start. This works because the binaries should be copied into the jar file at compile time.