compiling Xwindow programs

Submitted by Haynes Mathew
on February 19, 2004 - 2:23am

hi..

i am reading a book on x window applications programming.so there is this very small code to connect to the X server..

it goes like..

#include"stdio.h" /*(note replace the " here by < and > */
#include"X11/Xlib.h" /* the < and > were not coming on the preview ) */
main()
{

Display *display;
display=XOpenDisplay((char *)NULL);
if(display==NULL)printf("no connection made..\n");

else printf("connection made..\n");
}

but on compiling this program using

gcc -o X.o X.c -lX11

i get the error -lX11 not found ...

can anyone please help me with this... i am running rh9.

thanks

Haynes

x-headers installed..

Anonymous
on
February 19, 2004 - 12:41pm

Have you installed headers of x... XFree86-devel or something.. in debian i think it's this package: x-window-system-dev

x-headers

on
March 3, 2004 - 11:59pm

try to compile and to install new XFree source. the great one !
no need to use pre-compiled packets :)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.