Compiling Xlib-Based programs requires linking them with the Xlib library. This is done using a compilation command like this: g++ -o stuff prog-2.cc -L/usr/X11/lib -lX11 source: choo
g++ -o stuff prog-2.cc -L/usr/X11/lib -lX11