如何修复 GCC fatal error: X11/Xlib.h: No such file or directory on Ubuntu
问题
尝试编译 C/C++ 软件时,你看到如下错误消息
x11_missing_error.txt
wmname.c:6:10: fatal error: X11/Xlib.h: No such file or directory
6 | #include <X11/Xlib.h>
| ^~~~~~~~~~~~
compilation terminated.解决方案
你需要安装 libx11-dev 包:
install_libx11.sh
sudo apt install libx11-dev此包包含 X11 开发所需的头文件。
安装后,再次尝试编译你的软件。
Check out similar posts by category:
C/C++
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow