X11 libraries not found on Mac OS X 10.6

Alec Jacobson

June 28, 2010

weblog/

I never had this trouble on my mac os x 10.5 machine, but now on 10.6 I'm getting errors when including X11 libraries. When I try to compile using -lX11 or -lXext I get complaints from the linker like
ld: library not found for -lX11
or
ld: library not found for -lXext
To fix this you could modify your environment paths, or add the following to your compile flags:
-L/usr/X11/lib
I do that and everything compiles and links fine.