XWindows programming + gcc linker options

Im trying to compile some code that involves using X-Windows based functions (XDisplayName() and XOpenDisplay() ), however each time I run the compiler, Im getting a problem with the linker.

The linker says that both XDisplayName() and XOpenDisplay() are unresolved text symbols. Is there a specific option I should be specifying in the compile command for the X-Windows functions to be legitimately recognised ?

Warm Regards

Never mind, I figured it out thru some trial and error (a bit of reading on the way :P)

For those interested, whenever you compile a program (which contains XWindows-based functions) in gcc, do the following


gcc  -compiler options  myprogram.c  -o  myprogram  -lX11

-lX11 is the linking option you need to be able to use XWindows based functions