linux - 无法将 Qt 应用程序作为独立应用程序运行

标签 linux shared-libraries virtualbox qt5.5

我尝试创建独立 Web 应用程序的步骤

主机是 Ubuntu 14.04,64 位操作系统。

Qt 版本 - Qt5.6。

在虚拟 Box Ubuntu 14.04、64 位操作系统上进行测试。

应用程序在主机上正常运行。

我复制了所有 Web 相关文件和进程、平台相关文件和可执行文件所在的 lib 文件,然后我将库路径重定向到可执行文件的当前工作目录。

command used : chrpath -r ./lib AppName 

然后当我运行应用程序时,它的中断为

This application failed to start because it could not find or load the Qt platform plugin "xcb".
Available platform plugins are: xcb.
Reinstalling the application may fix this problem.
Aborted (core dumped)

我在 libqxcb.so 上运行了 ldd 以查找依赖文件。

command : ldd libqxcb.so

我通过手动将“未找到的文件”复制到/usr/lib 路径解决了这个问题

libQt5XcbQpa.so.5 
libQt5DBus.so.5
libQt5Core.so.5
libQt5Gui.so.5 

现在应用程序由于以下错误而中断:

QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
Qt WebEngine data directory not found at location /home/user/Qt5.5.1/5.5/gcc_64. Trying application directory...
Qt WebEngine Plugins directory not found. Trying fallback directory... Plugins as for example video codecs MAY NOT work.
Installed Qt WebEngine locales directory not found at location /home/user/Qt5.5.1/5.5/gcc_64/translations/qtwebengine_locales. Trying application directory...
Qt WebEngine data directory not found at location /home/user/Qt5.5.1/5.5/gcc_64. Trying application directory...
Qt WebEngine Plugins directory not found. Trying fallback directory... Plugins as for example video codecs MAY NOT work.
Installed Qt WebEngine locales directory not found at location /home/user/Qt5.5.1/5.5/gcc_64/translations/qtwebengine_locales. Trying application directory...
QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
QOpenGLWidget: Failed to create context
QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
QOpenGLWidget: Failed to create context
composeAndFlush: makeCurrent() failed
composeAndFlush: makeCurrent() failed
composeAndFlush: makeCurrent() failed
Segmentation fault (core dumped)

谁能指导我解决上述问题。

提前致谢。

最佳答案

你有在虚拟盒子中运行的桌面版 Ubuntu 吗?

您是否在 VM 选项中启用了“启用 3D 加速”。

您是否安装了 Virtualbox 视频驱动程序?

问题是 QtWebengine 需要 OpenGL 才能工作,这就是您收到此错误的原因:

QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled

关于linux - 无法将 Qt 应用程序作为独立应用程序运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37547439/

相关文章:

linux - 一个 Shell 脚本,用于在一个步骤中以文件夹名称作为参数查找并 cd 到文件夹中

c++ - 初始化文件范围变量时出现段错误

python - 如何在 Python 3 中使用 Python 2 中的 .so 模块?

linux - “vagrant up”在 Windows 上不起作用

android - 为什么当我运行 "adb devices"时我的 genymotion 设备没有列出

linux - 将软件包移植到 powerpc 需要什么工具?

linux -/dev/input/by-path/pci-xxx-kbd输出的格式是什么?

linux - 如何用另一个文件中的另一组替换一个文件中的一组字符串

c++ - 我们可以在 Windows 上使用 .so 文件吗?

google-chrome - 无法在 virtualbox 中为 Chrome 启用 webgl