Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ld can't find X11 library on OSX Leopard

Tags:

macos

x11

I have a pretty basic X11 app that I run on Linux that I'm trying to get compiled under OSX 10.5.8. I have X11 and the X11 SDK installed, and modified the makefile as follows:

CFLAGS = -L/usr/X11/lib -I/usr/X11/include

Everything compiles fine, but the linker can't find the X11 lib.

ld: library not found for -lX11

I've looked on google, but the only other people I've found with this problem so far either didn't have the X11 SDK installed or didn't know about the -L flag.

Any ideas?

like image 412
Larry Coleman Avatar asked Jan 22 '23 04:01

Larry Coleman


1 Answers

gcc SimpleXlibApp.c -o SimpleXlibApp -lX11 -L/usr/X11/lib -I/usr/X11/include

That line compiles the example here: http://en.wikipedia.org/wiki/Xlib

like image 135
Juan Carlos Kuri Pinto Avatar answered Jan 26 '23 05:01

Juan Carlos Kuri Pinto