I am having some trouble moving to v 5.0.0. I've been using Native.loadLibrary and, even though it's deprecated it still works. However, I am attempting to switch to Native.load. It took me a while to realize that the first argument to the two functions are not the same. With loadLibrary, I can pass an absolute path. With load, I apparently can only pass the library name and have to do something else to tell it where to search. This strikes me as a step backward in terms of user friendliness. Nevertheless, I found NativeLibrary.addSearchPath but am having trouble making it work. Should the path argument to that function have a terminating path separator character or not?
– Jeff
Jeffrey A. Cummings
Engineering Specialist
Mission Analysis and Operations Department
Systems Analysis and Simulation Subdivision
Systems Engineering Division
Engineering and Technology Group
The Aerospace Corporation
571-304-7548
jeffrey.a...@aero.org
-----Original Message-----
From:
jna-...@googlegroups.com [mailto:
jna-...@googlegroups.com] On Behalf Of Matthias Bläsing
Sent: Wednesday, October 10, 2018 1:34 PM
To:
jna-...@googlegroups.com
Subject: Re: Ignore binding error
Hi Nat,
Am Mittwoch, den 10.10.2018, 07:02 -0700 schrieb Nat:
> I am trying to write JNA app to handle different version of OpenSSL
> and it might have different methods defined depending on the compiler
> options. Is it possible to define a method that might not exist and
> make it to ignore the error when the symbol is not found? Currently,
> I'm getting "java.lang.UnsatistisfiedLinkError" with symbol not found
> error message when I have a method that does not have a corresponding
> symbol in the library.
depends which Mapping you are using:
* Regular Mapping (using interfaces) does the symbol lookup on
first invokation. So if you should by safe as long as you don't call
out into one of the missing functions. Even then you can recover:
You can catch the UnstatisfiedLinkError at lookup time and do
something intelligent as alternative
* Direct Mapping: I currently see no easy way
Maybe that helps
Matthias
--
You received this message because you are subscribed to the Google Groups "Java Native Access" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
jna-users+...@googlegroups.com.
For more options, visit
https://groups.google.com/d/optout.