Can't find X11 libraries! (C++)

balaji

Registered
Hi All,

I am trying to use the X11 libraries in my program:-
#include <X11/Xlib.h>
int main() {
return 0;
}


I am compiling using:-
g++ TestX11.cpp -I/usr/X11R6/include -lm -L/usr/X11R6/lib -lX11

I am getting the following error:-
TestX11.cpp:1:22: X11/Xlib.h: No such file or directory

X11 is available in this directory:-
{mac_name}:~/Desktop/Test {mac_name}$ ls -l /usr/X11R6/
total 16
-r--r--r-- 1 root wheel 1498 14 Sep 2003 ACKNOWLEDGEMENTS
-r--r--r-- 1 root wheel 3589 14 Sep 2003 README
drwxr-xr-x 139 root wheel 4726 4 Aug 09:52 bin
drwxr-xr-x 3 root wheel 102 8 Mar 2005 include
drwxr-xr-x 95 root wheel 3230 4 Aug 09:52 lib
drwxr-xr-x 5 root wheel 170 2 Sep 04:31 man


If someone has used X11 in their C/C++ programs please advise.

Thanks for your help,
BG
 
It compiles fine on my machine. You need to make sure that you've installed the X11 developer libraries too, I think these are included in Xcode and not in the X11 client that comes with Tiger.
 
Back
Top