redhat 7.2jp で下記を,gcc -L/usr/X11R6 -I/usr/X11R6 xp.c -o xp
とすると、
/tmp/ccKj0Thr.o: In function `main':
/tmp/ccKj0Thr.o(.text+0xc): undefined reference to `XOpenDisplay'
/tmp/ccKj0Thr.o(.text+0x1f): undefined reference to `XCloseDisplay'
collect2: ld returned 1 exit status
となります。なぜ?

#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <stdio.h>
main()
{
Display *dsp;
dsp = XOpenDisplay ( NULL );
XCloseDisplay (dsp);
}