NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Compiling a hello world X program



Hello,

I am trying to compile a Hello World program for X Window, but it
fails with an error on NetBSD 7.1

xhello.c:2:22: fatal error: X11/Xlib.h: No such file or directory

My program is

#include <stdio.h>
#include <X11/Xlib.h>

int main(int argc, char **argv) {
return 0;
}

My makefile is

$ cat Makefile
.PHONY: clean
xhello: xhello.o
        cc -static -o xhello xhello.o -L /usr/X11R7/lib -lX11

xhello.o: xhello.c
        cc -I/usr/x11R7/include -c xhello.c

clean:
        rm -f *.o xhello

Full error is

$ make
cc -I/usr/x11R7/include -c xhello.c
xhello.c:2:22: fatal error: X11/Xlib.h: No such file or directory
 #include <X11/Xlib.h>
                      ^
compilation terminated.
*** Error code 1

Stop.
make: stopped in /home/rambius/drafts/X

I verified that /usr/x11R7/include exists and that it has X11/Xlib.h
header file.

What am I doing wrong? I will be very grateful for any hints.

Regards
rambius

-- 
Tangra Mega Rock: http://www.radiotangra.com


Home | Main Index | Thread Index | Old Index