我从维基百科复制粘贴这段代码: http://en.wikipedia.org/wiki/Xlib
我收到这个错误:
fatal error C1083: Cannot open include file: 'X11/Xlib.h': No such file or directory
我假设它适用于 c++,即使代码是 c,或者至少找到 x11 库?
一整天都被这个问题困住了...有人知道我做错了什么吗?
最佳答案
根据您对 Microsoft Visual C++ 的使用情况,我假设您使用的是 Windows 平台。 现在,来自 http://en.wikipedia.org/wiki/X_Window_System引用自 http://en.wikipedia.org/wiki/Xlib :
Microsoft Windows is not shipped with support for X, but many third-party implementations exist, as free and open source software such as Cygwin/X, and proprietary products such as Exceed, MKS X/Server, Reflection X, X-Win32 and Xming.
这就是为什么编译器找不到“X11/XLib.h”头文件的原因。您将需要安装这些实现之一,或者使用抽象层,例如 http://en.wikipedia.org/wiki/Xlib 中提到的那些之一。 (GTK+、Qt、SDL……)
关于c++ - x11/xlib 与 microsoft visual c++,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22283867/