harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Enrico Migliore <enrico.migli...@fatti.com>
Subject Re: Classpath on Cygwin: failed to open native library error
Date Sat, 18 Feb 2006 16:21:38 GMT
snowdosker wrote:

> Hi, Enrico.
>
> Just figured out the roots of the problem. It comes from  dlopen() 
> function on cygwin.
> *JCHEVM*  use the following code for loading native shared libraries
> in \cygwin\home\ivan\jchevm\libjc\native_lib.c line:330
>
>    else if ((handle = dlopen(dlname, RTLD_NOW)) == NULL) {
>        _JC_EX_STORE(env, UnsatisfiedLinkError,
>            "failed to open native library `%s': %s", name, dlerror());
>        goto fail;
>    }
>
> Exactly what we see in error output....
> So I just wrote simple test
>
>    if ((handle = 
> dlopen("/usr/local/classpath/lib/classpath/*libjavanio.dll.a*", 
> RTLD_NOW)) == NULL) {
>    printf("fail %s", dlerror());      }
>    else {
>        printf("loaded");
>    }
>
> And it's failed
> Well, then I tried to
>
>    if ((handle = 
> dlopen("/usr/local/classpath/lib/classpath/*cygjavanio-0.dll*", 
> RTLD_NOW)) == NULL) {
>    printf("fail %s", dlerror());      }
>    else {
>        printf("loaded");
>    }
>
> And got success ...!
> ----------------------
>
> I also had found some interesting articles related to libtool , dlopen 
> and  LoadLibrary API  function
> and thier behaviours under cygwin..
> Probably this will help to solve problem soon.....
> Well, if you will be more lucky in finding solution , just let me know
>
> Ivan

Hi Ivan,

good boy!

Let's browse the Cygwin documentation and see how dlopen() works.
Please share the link you've found :-)

dlopen() is a POSIX function.

Enrico


Mime
View raw message