I copy-past this code from Wikipedia: http://en.wikipedia.org/wiki/Xlib
And I'm getting this error:
fatal error C1083: Cannot open include file: 'X11/Xlib.h': No such file or directory
I assume it works for c++ even the though the code is c, or at least find the library x11?
Been stuck on this problem entire day... anyone have any idea what I'm doing wrong here?
Windows doesn't use the X11 windowing system, and so the Xlib library isn't available.
What are you trying to do? Why do you feel that you need Xlib on Windows?
I'm assuming from your usage of Microsoft visual C++ that you are on a windows platform. Now, from http://en.wikipedia.org/wiki/X_Window_System referenced from http://en.wikipedia.org/wiki/Xlib:
This is why the compiler can't find the "X11/XLib.h" header. You would need to either install one of those implementations or otherwise use an abstraction layer such as one of those mentioned in http://en.wikipedia.org/wiki/Xlib (GTK+, Qt, SDL, ...)
You have to install the X-Lib and X.org if you want to see something. Keep in mind, X11 is originally more common in/with Linux. However, I cannot advise to use the X-Lib anymore. Often it is strongly advisable to use Higher-Level-SDKs like Qt, GTK or WxWidgets. This has many advantages: