(Qt 5.4.1) 此应用程序无法启动,因为它无法找到或加载 Qt 平台插件“xcb".

2023-01-02C/C++开发问题
5

本文介绍了(Qt 5.4.1) 此应用程序无法启动,因为它无法找到或加载 Qt 平台插件“xcb".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我重新安装了 ubuntu 14.04、Qt 5.4.1 和 Qtcreator.

I reinstalled my ubuntu 14.04 and Qt 5.4.1 and Qtcreator.

Qt 5.4.1 是从源代码构建的,带有-opensource -nomake-test -nomake-example"配置选项.

Qt 5.4.1 was built from source with "-opensource -nomake-test -nomake-example" configure options.

当我在 QtCreator 中打开一个旧项目并构建它时,一切正常.

When I open an old project in QtCreator and build it everything's OK.

但是当我运行这个项目时它显示:

But when I run this project it shows:

此应用程序无法启动,因为它无法找到或加载 Qt 平台插件xcb".

This application failed to start because it could not find or load the Qt platform plugin "xcb".

可用的平台插件有:linuxfb、minimal、offscreen、xcb.

Available platform plugins are: linuxfb, minimal, offscreen, xcb.

重新安装应用程序可能会解决此问题.中止(核心转储)

Reinstalling the application may fix this problem. Aborted (core dumped)

所以我用谷歌搜索了这个问题并尝试了一切.我安装了所有软件包(libxcb 系列)但没有任何帮助!

So I googled this problem and tried everything. I installed every packages (libxcb series) but nothing can help!

请有人帮助我...

我试过你的方法.

当我在 platform 目录中运行 ldd 命令时,它显示:

When I run ldd command in platform directory, It shows:

你可以看到什么都没有丢失.实际上我已经在名为 libqxcb.so 的平台目录中创建了一个软链接.之前我的平台目录下没有libqxcb.so.

You can see that nothing is missing. And actually I have made a softlink in the platform directory called libqxcb.so. There was no libqxcb.so in my platform directory before.

当我对我的可执行文件运行 ldd 命令时.表明:

And when I run ldd command to my executable. it shows:

当我执行这个文件时你可以看到错误.

And you can see the error when I execute this file.

推荐答案

对于类似的问题,在我的情况下,我解决了:

For a similar issue, in my case I solved with:

export QT_PLUGIN_PATH=<qt base path>/plugins

这篇关于(Qt 5.4.1) 此应用程序无法启动,因为它无法找到或加载 Qt 平台插件“xcb".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

无法访问 C++ std::set 中对象的非常量成员函数
Unable to access non-const member functions of objects in C++ std::set(无法访问 C++ std::set 中对象的非常量成员函数)...
2024-08-14 C/C++开发问题
17

从 lambda 构造 std::function 参数
Constructing std::function argument from lambda(从 lambda 构造 std::function 参数)...
2024-08-14 C/C++开发问题
25

STL BigInt 类实现
STL BigInt class implementation(STL BigInt 类实现)...
2024-08-14 C/C++开发问题
3

使用 std::atomic 和 std::condition_variable 同步不可靠
Sync is unreliable using std::atomic and std::condition_variable(使用 std::atomic 和 std::condition_variable 同步不可靠)...
2024-08-14 C/C++开发问题
17

在 STL 中将列表元素移动到末尾
Move list element to the end in STL(在 STL 中将列表元素移动到末尾)...
2024-08-14 C/C++开发问题
9

为什么禁止对存储在 STL 容器中的类重载 operator&amp;()?
Why is overloading operatoramp;() prohibited for classes stored in STL containers?(为什么禁止对存储在 STL 容器中的类重载 operatoramp;()?)...
2024-08-14 C/C++开发问题
6