Dynamic loading of cygwin dependent dlls

Mark Bohlman mbohlman@tcicredit.com
Wed Aug 11 13:30:00 GMT 2004


Peter Ekberg wrote:
>>>Ah, now I see it. You have to be careful with your typing.
>>>pseudo_stubs.dll (with one s in the end) is the name that fails.
>>>Apparently both pseudo_stub.dll (no s) and psuedo_stubs.dll (bad
>>>spelling) work. And pseudo_stubss.dll (double s) definitely 
>>
>>works, that
>>
>>>I have tried myself.
>>
>>You have checked what error 998 actually is?
>>
>>#define ERROR_NOACCESS 998L
> 
> 
> Of course. I have also checked what might cause the error. See:
> http://support.microsoft.com/default.aspx?scid=kb;en-us;q196069
> 
> I can also say that I have tried to use the pure Win32 LoadLibrary call
> on the resulting dlls, and the results are consistent with the dlopen
> results. My guess is that there is something wrong inside the dll, that
> causes a segfault during dlopen/LoadLibrary.
> 
> 
>>I cannot believe that it depends on the name of a DLL whether it can
>>be dlopened or not.
> 
> 
> Me neither, yet the name appears to be significant in some way.
> 
> 
>>                     There must be another error with your test!
>>
>>Consider this (with source from your first posting):
>>$ gcc -shared -o pseudo_stubs.dll foo.c
>>$ gcc -o load load.c
>>$ ./load
>>pseudo_stubs.dll        ok
>>foo.dll dlopen: Win32 error 126
>>$ cp pseudo_stubs.dll foo.dll
>>$ ./load
>>pseudo_stubs.dll        ok
>>foo.dll ok
> 
> 
> Hey, that doesn't explain anything. It's like answering someones awk bug
> report with "see, it works with sed, your test must be wrong". Apart
> from that, thanks for the example, the project now uses "gcc -shared"
> with apparent success. So for me, this problem is now academic.
> 
> I'm not saying that it is the name of the dll that is causing the
> problem. If I build the dll as foo.dll with dlltool/dllwrap and rename
> it to pseudo_stubs.dll, pseudo_stubs.dll works. Also, if I build the dll
> as pseudo_stubs.dll and rename it foo.dll, foo.dll doesn't work.
> 
> I'd say that there is some sort of problem in dlltool/dllwrap. Please
> enlighten me if I'm using them incorrectly.
> 
> Can someone also please say if they get error 998 for the example in the
> original post, or if that happens on my machine only.
> 
> Cheers,
> Peter
> 

I got the same results on my XP machine (998) as in your original post. 
  Seems to me that renaming was the entire problem but didn't spend much 
time on it, so that my Quick Assessment(tm).
-- Mark


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list