(Qt 5.4.1) This application could not be launched because it could not find or download the Qt platform plugin "xcb",

I reinstalled my ubuntu 14.04 and Qt 5.4.1 and Qtcreator.

Qt 5.4.1 was built from a source with the configuration parameters "-opensource -nomake-test -nomake-example".

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

But when I run this project, it shows:

This application could not be started because it could not find or download the Qt platform plugin "xcb".

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

Reinstalling the application may fix this problem. Canceled (kernel resets)

So, I searched for this problem and tried everything. I installed all the packages (libxcb series), but nothing can help!

Someone help me ...

I tried your methods.

When I run the ldd command in the platform directory, it shows: ldd libqxcb.so under platform $

You can see that nothing is missing. And actually I made softlink in the platform directory of libqxcb.so. There used to be no libqxcb.so in my platform directory.

And when I run the ldd command for my executable. it shows: executable shot

And you may see an error while executing this file.

+2
source share
9 answers

For a similar problem, in my case, I decided:

 export QT_PLUGIN_PATH=<qt base path>/plugins 
+10
source

Try ldd libqxcb.so to the platforms folder to install Qt, which your program uses and runs ldd libqxcb.so on the command line. Then check the output if there are any missing dependencies. If libqxcb.so missing one of its dependencies, this leads to the output you mentioned.

You can also use the ldd command in your executable file to check if there are any dependencies that cannot be found.

Here is an example of what the missing dependencies in the ldd output look like:

Example of <code> ldd </code> output

PS: the accepted answer of this question may also help you (creating a qt.conf file).

+6
source

I just looped on a very similar issue for several hours and nothing was “found” in the ldd results for the corresponding executable, or libqxcb.so. finally, I found a problem with the executable itself, but not with Qt. Tried QT_QPA_PLATFORM='' executable and it works :)

+4
source

'This application could not be launched because it could not find or download the Qt platform plugin "xcb".

See the accompanying webpage, scroll down to the heading "Qt Plugins". See the first paragraph.

libqxcb.so is required even if you link the rest statically.

http://doc.qt.io/qt-5/linux-deployment.html#application-dependencies

Qt probably wrote its source code software to work as follows: Instead of letting libqxcb.so load automatically at startup (using rpath's), they use the dlopen () function to load it, as part of their QPA set of functions shortly after the start of main ().

Thus, this completely ignores our attempt to include all the "xcb" functions statically.

If their dlopen () fails, they simply pull out their error message, which we all know and hate, and then call signal 6 to abort it (completely optional) instead of the usual exit.

+2
source

I got this exact error on Linux Xubuntu 18.04

 qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" 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, xcb. Aborted (core dumped) 

First, defining this environment variable before starting qtcreator from the command line leads to additional debugging output:

 export QT_DEBUG_PLUGINS=1 

And then in debugging he said this while trying to run qtcreator from the command line on xubuntu 18.04:

 Cannot load library /home/myuser/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so: (libxkbcommon-x11.so.0: cannot open shared object file: No such file or directory) 

Note that it cannot find libxkbcommon-x11, so the fix was as follows:

 sudo apt-get install libxkbcommon-x11-dev export PATH=$PATH:~/Qt/Tools/QtCreator/bin 

Qtcreator now starts.

+1
source
 export QT_PLUGIN_PATH=<your qt installation path>/plugins/platforms 

Like what mbjoe says, it really works!

0
source

for those who have not yet found a solution and are desperate for an answer, this is a copy of what @wardw currently commented on with the highest rated response, which helped me solve the main problem.

 export QT_DEBUG_PLUGINS=1 

put this either in the launch configuration or in the console before starting the project and it will print more information about what is wrong.

0
source

This may be obvious, but I got this error when starting the GUI from (without displaying) an SSH session [Why? I was developing an embedded application on a much larger screen, right next to the tiny touch screen it was designed for].

Anyway, in bash, the following command sets the application to its own screen:

 export DISPLAY=':0.0' 

Hope this helps someone.

0
source

Run the command:

sudo./app-name -platform linuxfb

-1
source

Source: https://habr.com/ru/post/1238189/


All Articles