Build with MinGW GCC, link to Cygwin libs, program doesn't work
Mon Sep 12 21:21:00 GMT 2005
I've built a simple application by compiling the source with the MinGW
version of GCC 3.3.1 , and linking to the regular Cygwin X11 libraries.
int main(int argc, char *argv)
display = XOpenDisplay(":0.0");
if (display == NULL)
fprintf(stderr, "can't connect to X server\n");
My C_INCLUDE_PATH environment variable points to the
c:\cygwin\usr\X11R6\include , and my LIBRARY_PATH variable points to
> gcc -o test test.c -lX11-6
the code compiles and links successfully. I run XWin.exe (which works
properly; I am able to use xeyes, xfontsel, etc.) and then launch my
program. It gets stuck on the call to XOpenDisplay(), and does nothing but
run the CPU up to 99% load until I send it a Ctrl-C.
I'm not very familiar with Cygwin, and wouldn't know where to start looking
to troubleshoot this. Has anyone ever experienced anything similar to this
problem, or know where I could look to get started? I skimmed the FAQ but
didn't seem to find anything relevant.
Thanks in advance for any help.
(Switching compilers or Cygwin versions isn't really possible, since our
customer is dictating what build environment we use. I'm attempting to use
the Cygwin X libraries since we're evaluating alternatives to the
commercial off-the-shelf X server and client software we're currently using.)
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
More information about the Cygwin-xfree