You need not just X, but also Xlib development headers to be installed. At least, that's the case on linux