LoadLibrary("cygx11-6.dll") results in STATUS_ACCESS_VIOLATION

Charles Wilson cygwin@cwilson.fastmail.fm
Sun Oct 24 20:46:00 GMT 2004

Alexander Gottwald wrote:
>>I am trying to write an x client application that will run on a windows xp
>>machine. When I try to load any X related dll (in order to be able to call
>>for example XOpenDisplay) the executable exits whith the message
>>5 [main] test3 2820 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
>>648 [main] test3 2820 open_stackdumpfile: Dumping stack trace to
>>This dump occurs when the system tries to load the library.
> Why not link the library directly into the program? I'm not sure if LoadLibrary
> works well with cygwin dlls.

LoadLibrary usually works okay --- but it'd certainly be better, from a 
cygwin POV, to use cygwin1.dll's dlopen() instead.  And there is 
sometimes a good reason to avoid direct linking: what if you want to 
"turn on" various windowing/GUI modes...e.g. rxvt on cygwin can 
currently be used without an Xserver running, without even having the X 
libs installed.  If $DISPLAY is :0, it never tries to load the X stuff, 
but simply uses Windows GDI.  If the Xlibs were linked directly into the 
app, you'd always have to have the Xlibs installed, even if you didn't 
want to ever use rxvt in "X11" mode.


More information about the Cygwin-xfree mailing list