I am using GCC, what switches do I need to add to link with Xlib? After searching, all I could find was -lX11, but that gave me ld: library not found for -lX1
-lX11
ld: library not found for -lX1
You also need -L/usr/X11/lib. It's not exactly Mac-specific, but you will find that the location of these libs will vary a bit from system to system.
-L/usr/X11/lib