c++ - x11/xlib 与 microsoft visual c++

标签 c++ visual-studio-2010 graphics xlib

我从维基百科复制粘贴这段代码: 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/

相关文章:

c# - Windows 窗体并行绘图

java - Fireworks Graphics,为什么 Canvas 不显示?

c++ - 指针的部分特化,C++

asp.net - 为什么我的嵌套母版页丢失了 CSS 格式?

unit-testing - VS2010 中仪器组件的目的是什么?

visual-studio-2010 - Web Deploy打包在我的构建服务器上不起作用

Java 图形表现奇怪

c++ - 如何为我的 curses 应用程序关闭或忽略按键重复?

c++ - 在 clang 中声明一个非别名变量?

c++ - 由定义指令定义的类名。可能的?