ERROR之command not found qt.qpa.plugin: Could not load the Qt platform plugin “xcb“

解决 Qt 平台插件 “xcb” 问题及运行 Xvfb

目录

  • 解决 Qt 平台插件 "xcb" 问题及运行 Xvfb
    • 背景
    • 步骤
      • 1.检查当前的 DISPLAY 变量
      • 2.安装和配置 `xauth`
      • 3.启动 `Xvfb` 虚拟显示器
      • 4.验证 `Xvfb` 功能
      • 5.安装 Qt 相关库
      • 6.运行您的脚本

背景

在使用 xvfb-run 运行一些需要图形显示的应用程序时,您可能会遇到 Qt 平台插件相关的错误。为了确保虚拟显示器 Xvfb 正确配置并解决 Qt 插件问题,以下是完整的解决步骤。

/usr/bin/xvfb-run: line 184: : command not found
qt.qpa.plugin: Could not load the Qt platform plugin “xcb” in “xxxxxxxxxx” even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, webgl, xcb.

步骤

1.检查当前的 DISPLAY 变量

首先,确认当前 DISPLAY 环境变量的值:

echo "DISPLAY=$DISPLAY&#

你可能感兴趣的:(ERROR,qt,开发语言)