I'm trying to compile the example screensaver simplesquares.c (from here). I have vroot.h, and this is the command I'm using:
gcc -lX11 -o simplesquares simplesquares.c
These are the errors returned:
/tmp/cc0FvxcU.o: In function `VirtualRootWindowOfScreen':
simplesquares.c:(.text+0x55): undefined reference to `XInternAtom'
simplesquares.c:(.text+0x82): undefined reference to `XQueryTree'
simplesquares.c:(.text+0x108): undefined reference to `XGetWindowProperty'
simplesquares.c:(.text+0x14c): undefined reference to `XFree'
/tmp/cc0FvxcU.o: In function `main':
simplesquares.c:(.text+0x17b): undefined reference to `XOpenDisplay'
simplesquares.c:(.text+0x1c8): undefined reference to `XCreateGC'
simplesquares.c:(.text+0x201): undefined reference to `XSetForeground'
simplesquares.c:(.text+0x295): undefined reference to `XFillRectangle'
simplesquares.c:(.text+0x2e3): undefined reference to `XClearWindow'
simplesquares.c:(.text+0x2ef): undefined reference to `XFlush'
collect2: error: ld returned 1 exit status
What is happening here, and how can I fix it?