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

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

export QT_PLUGIN_PATH=<qt base path>/plugins

Try to go to the platforms folder of the Qt installation your program is using and run ldd libqxcb.so in a command prompt. Then check in the output if there are any missing dependencies. If the libqxcb.so is missing one of its dependencies this produces the output you mentioned.

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

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

Example of <code>ldd</code> output

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


I just stuck into a very similar issue for hours, also nothing is "not found" in ldd results on related executable, or libqxcb.so. finally I found it's the issue with the executable itself but not Qt. Tried QT_QPA_PLATFORM='' executable and it works :)