Linking against libX11

davidbrit2

Licensed Computer Geek
Alright, so I'm trying to build some simple X11 programs. It compiles just fine, but when it hits linking stage, it's can't find the symbols that would be in xlib. However, I see quite a few libX11 files in /usr/X11R6/lib, so I suspect it's not including that in the search path. I also tried adding -lX11 to the gcc command, but no luck. So, what remarkably daft thing have I screwed up this time?
 
There we go, that worked perfectly. But strangely enough, the -I path is optional, but -L is required. Weird. In any case, thanks. Now I can resume testing utterly useless X11 sample code. ;-)
 
Back
Top