On Sep 20, 2012, at 8:59 AM, Erick Moreno wrote:
> Hi All,
>
> I'm completely newbie in JNA and I confess that I don't know a lot about C programming. But I'm trying to map com calls from a c software compiled by me and I'm having some troubles.
If you understand what "compiled" means, then you wouldn't be asking if JNA should look for a .c file. JNA can load a shared library, which is built from source files in a special way, into a file called libXXXX.so, where XXXX is the "name" of your library.
>
> I'm quite sure that I'm passing correct path to the software using
> -Djna.library.path=/root/voicerlib/voicerlib-4.2.4.0/src_common/ parameter but I'm still receiving the java.lang.UnsatisfiedLinkError error.
>
> The first thing that I notice is that I'm using "voicerlib" as lib name (since I believe that this is the real name of the lib). But JNA is looking for a libvoicerlib.so file that doesn't exists.
>
> - So, why is JNA adding the 'lib' prefix to the name file?
> - And, why is JNA looking for a .so extension? Can a configure to look for just a .c file?
Read the documentation on how JNA maps a library "name" into an actual filename. What is the name of the file of the library you're trying to load? Whether you built it yourself or downloaded a package, it's not likely to be found in src_common.
When you call Native.loadLibrary(), you can always pass an absolute path to the file you want to load.