x11/extensions/xrandr.h:No such file or directory

在CentOS6.9环境下,遇到x11/extensions/xrandr.h缺失的问题,通过执行'yum install libXrandr-devel'成功安装了必要的开发库,从而解决了该错误。

x11/extensions/xrandr.h:No such file or directory解决办法

我的环境是centos6.9,然后如下解决了:

yum install libXrandr-devel
# 验证GL渲染器 DISPLAY=:0 glxinfo | grep "OpenGL renderer" # 检查内核消息 dmesg | grep -iE "drm|vga|fb0" Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package libdrm-tools Command 'drm_info' not found, but can be installed with: apt install drm-info Error: unable to open display :0 [ 7.227977] Console: colour VGA+ 80x25 [ 7.654513] vgaarb: loaded [ 8.488129] ACPI: bus type drm_connector registered [ 11.694958] systemd[1]: Starting modprobe@drm.service - Load Kernel Module drm... root@srv771551:~# # 强制使用fbdev驱动 startx -- -config /etc/X11/xorg.conf.d/20-gpu.conf -retro # 使用最低配置模式 Xorg -noreset -keeptty -verbose 3 :0 X.Org X Server 1.21.1.11 X Protocol Version 11, Revision 0 Current Operating System: Linux srv771551 6.8.0-60-generic #63-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 15 19:04:15 UTC 2025 x86_64 Kernel command line: BOOT_IMAGE=/vmlinuz-6.8.0-60-generic root=UUID=30964bc7-c7b0-4ada-9642-1f49d6e6c210 ro console=tty0 console=ttyS0,115200 earlyprintk=ttyS0,115200 consoleblank=0 memhp_default_state=online console=tty1 console=ttyS0 xorg-server 2:21.1.12-1ubuntu1.3 (For technical support please see http://www.ubuntu.com/support) Current version of pixman: 0.42.2 Before reporting problems, check http://wiki.x.org to make sure that you have the latest version. Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown. (==) Log file: "/var/log/Xorg.0.log", Time: Tue May 27 22:12:19 2025 (++) Using config file: "/etc/X11/xorg.conf.d/20-gpu.conf" (==) Using config directory: "/etc/X11/xorg.conf.d" (==) Using system config directory "/usr/share/X11/xorg.conf.d" (EE) Fatal server error: (EE) no screens found(EE) (EE) Please consult the The X.Org Foundation support at http://wiki.x.org for help. (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information. (EE) (EE) Server terminated with error (1). Closing log file. xinit: giving up xinit: unable to connect to X server: Connection refused xinit: server error X.Org X Server 1.21.1.11 X Protocol Version 11, Revision 0 Current Operating System: Linux srv771551 6.8.0-60-generic #63-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 15 19:04:15 UTC 2025 x86_64 Kernel command line: BOOT_IMAGE=/vmlinuz-6.8.0-60-generic root=UUID=30964bc7-c7b0-4ada-9642-1f49d6e6c210 ro console=tty0 console=ttyS0,115200 earlyprintk=ttyS0,115200 consoleblank=0 memhp_default_state=online console=tty1 console=ttyS0 xorg-server 2:21.1.12-1ubuntu1.3 (For technical support please see http://www.ubuntu.com/support) Current version of pixman: 0.42.2 Before reporting problems, check http://wiki.x.org to make sure that you have the latest version. Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown. (==) Log file: "/var/log/Xorg.0.log", Time: Tue May 27 22:12:34 2025 (==) Using config directory: "/etc/X11/xorg.conf.d" (==) Using system config directory "/usr/share/X11/xorg.conf.d" (==) No Layout section. Using the first Screen section. (**) |-->Screen "Default Screen" (0) (**) | |-->Monitor "<default monitor>" (**) | |-->Device "Default Device" (**) | |-->GPUDevice "GPU0" (==) No monitor specified for screen "Default Screen". Using a default monitor configuration. (**) Allowing byte-swapped clients (==) Automatically adding devices (==) Automatically enabling devices (==) Automatically adding GPU devices (==) Automatically binding GPU devices (==) Max clients allowed: 256, resource mask: 0x1fffff (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist. Entry deleted from font path. (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist. Entry deleted from font path. (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist. Entry deleted from font path. (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist. Entry deleted from font path. (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist. Entry deleted from font path. (==) FontPath set to: /usr/share/fonts/X11/misc, /usr/share/fonts/X11/Type1, built-ins (==) ModulePath set to "/usr/lib/xorg/modules" (II) The server relies on udev to provide the list of input devices. If no devices become available, reconfigure udev or disable AutoAddDevices. (II) Loader magic: 0x576497426020 (II) Module ABI versions: X.Org ANSI C Emulation: 0.4 X.Org Video Driver: 25.2 X.Org XInput driver : 24.4 X.Org Server Extension : 10.0 (--) using VT number 3 (II) systemd-logind: took control of session /org/freedesktop/login1/session/_38 (II) LoadModule: "glx" (II) Loading /usr/lib/xorg/modules/extensions/libglx.so (II) Module glx: vendor="X.Org Foundation" compiled for 1.21.1.11, module version = 1.0.0 ABI class: X.Org Server Extension, version 10.0 (II) LoadModule: "vesa" (II) Loading /usr/lib/xorg/modules/drivers/vesa_drv.so (II) Module vesa: vendor="X.Org Foundation" compiled for 1.21.1.7, module version = 2.6.0 Module class: X.Org Video Driver ABI class: X.Org Video Driver, version 25.2 (II) LoadModule: "modesetting" (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so (II) Module modesetting: vendor="X.Org Foundation" compiled for 1.21.1.11, module version = 1.21.1 Module class: X.Org Video Driver ABI class: X.Org Video Driver, version 25.2 (II) VESA: driver for VESA chipsets: vesa (II) modesetting: Driver for Modesetting Kernel Drivers: kms (WW) Falling back to old probe method for modesetting (EE) open /dev/dri/card0: No such file or directory (WW) Falling back to old probe method for modesetting (EE) open /dev/dri/card0: No such file or directory (EE) No devices detected. (==) Matched modesetting as autoconfigured driver 0 (==) Matched fbdev as autoconfigured driver 1 (==) Matched vesa as autoconfigured driver 2 (==) Assigned the driver to the xf86ConfigLayout (II) LoadModule: "modesetting" (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so (II) Module modesetting: vendor="X.Org Foundation" compiled for 1.21.1.11, module version = 1.21.1 Module class: X.Org Video Driver ABI class: X.Org Video Driver, version 25.2 (II) UnloadModule: "modesetting" (II) Unloading modesetting (II) Failed to load module "modesetting" (already loaded, 0) (II) LoadModule: "fbdev" (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so (II) Module fbdev: vendor="X.Org Foundation" compiled for 1.21.1.11, module version = 0.5.0 Module class: X.Org Video Driver ABI class: X.Org Video Driver, version 25.2 (II) LoadModule: "vesa" (II) Loading /usr/lib/xorg/modules/drivers/vesa_drv.so (II) Module vesa: vendor="X.Org Foundation" compiled for 1.21.1.7, module version = 2.6.0 Module class: X.Org Video Driver ABI class: X.Org Video Driver, version 25.2 (II) UnloadModule: "vesa" (II) Unloading vesa (II) Failed to load module "vesa" (already loaded, 0) (II) VESA: driver for VESA chipsets: vesa (II) modesetting: Driver for Modesetting Kernel Drivers: kms (II) FBDEV: driver for framebuffer: fbdev (WW) Falling back to old probe method for modesetting (EE) open /dev/dri/card0: No such file or directory (EE) open /dev/dri/card0: No such file or directory (EE) open /dev/dri/card0: No such file or directory (EE) open /dev/dri/card0: No such file or directory (WW) Falling back to old probe method for fbdev (II) Loading sub module "fbdevhw" (II) LoadModule: "fbdevhw" (II) Loading /usr/lib/xorg/modules/libfbdevhw.so (II) Module fbdevhw: vendor="X.Org Foundation" compiled for 1.21.1.11, module version = 0.0.2 ABI class: X.Org Video Driver, version 25.2 (EE) open /dev/fb0: No such file or directory (WW) Falling back to old probe method for modesetting (EE) open /dev/dri/card0: No such file or directory (EE) open /dev/dri/card0: No such file or directory (EE) open /dev/dri/card0: No such file or directory (EE) open /dev/dri/card0: No such file or directory (WW) Falling back to old probe method for fbdev (II) Loading sub module "fbdevhw" (II) LoadModule: "fbdevhw" (II) Loading /usr/lib/xorg/modules/libfbdevhw.so (II) Module fbdevhw: vendor="X.Org Foundation" compiled for 1.21.1.11, module version = 0.0.2 ABI class: X.Org Video Driver, version 25.2 (EE) open /dev/fb0: No such file or directory (EE) No devices detected. (EE) Fatal server error: (EE) no screens found(EE) (EE) Please consult the The X.Org Foundation support at http://wiki.x.org for help. (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information. (EE) (EE) Server terminated with error (1). Closing log file. root@srv771551:~#
最新发布
05-29
<think>好的,我现在需要解决用户遇到的编译错误。错误信息是thirdparty/freeglut/src/x11/fg_internal_x11.h:42:10: fatal error: X11/extensions/XInput.h: No such file or directory。看起来是缺少了XInput.h头文件。 首先,我应该确认这个头文件属于哪个开发包。在基于Debian或Ubuntu的系统上,通常可以通过安装相应的-dev包来解决。XInput.h属于X11的扩展库,可能包含在libxi-dev包中。用户需要安装这个包才能找到所需的头文件。 接下来,用户可能需要使用包管理器来安装。例如,在Ubuntu上,运行sudo apt-get install libxi-dev应该能解决问题。安装完成后,重新编译项目应该就不会出现这个错误了。 另外,我还应该考虑到不同的Linux发行版可能有不同的包名。比如,Fedora或CentOS可能需要安装libXi-devel。如果用户使用的是其他发行版,可能需要调整安装命令。 最后,建议用户安装所有相关的开发包,比如libx11-dev、libxext-dev等,以确保所有依赖项都满足。如果问题依旧存在,可能需要检查包含路径或编译器标志是否正确设置了X11的头文件路径。</think>这个编译错误表明系统缺少 **XInput.h** 头文件,该文件属于 X Window 系统的输入扩展开发包。以下是逐步解决方案: ### 1. 问题定位 错误信息: ```bash X11/extensions/XInput.h: No such file or directory ``` 说明编译器在编译 FreeGLUT 的 X11 后端时,找不到 XInput 相关的头文件。 --- ### 2. 安装缺失的开发包 #### Debian/Ubuntu 系统 运行以下命令安装 **libxi-dev**: ```bash sudo apt-get update sudo apt-get install libxi-dev ``` #### Fedora/CentOS 系统 运行以下命令安装 **libXi-devel**: ```bash sudo dnf install libXi-devel # Fedora # 或 sudo yum install libXi-devel # CentOS ``` #### Arch Linux 系统 运行以下命令安装 **libxi**: ```bash sudo pacman -S libxi ``` --- ### 3. 验证安装 安装完成后,检查头文件是否存在: ```bash ls /usr/include/X11/extensions/XInput.h ``` 应输出: ``` /usr/include/X11/extensions/XInput.h ``` --- ### 4. 重新编译项目 重新执行编译命令(如 `make` 或 `cmake`),错误应已解决。 --- ### 5. 补充说明 如果仍存在问题,可能需要安装完整的 X11 开发工具链: ```bash sudo apt-get install xorg-dev # Debian/Ubuntu sudo dnf groupinstall "X Software Development" # Fedora ``` --- ### 技术背景 - **XInput.h** 属于 X Window System 的输入扩展(如触摸屏、手写板等设备支持)。 - FreeGLUT 依赖该头文件实现 X11 平台的输入事件处理。 - 开发包命名规则:`libxi` = 运行时库,`libxi-dev` = 开发头文件。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值