harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snowdosker <snowdos...@academ.org>
Subject Re: Classpath on Cygwin: failed to open native library error
Date Sat, 18 Feb 2006 13:31:07 GMT
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



Mime
View raw message