Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Trying to build static Qt5 in Ubuntu 12.04; all apps quit with 'Failed to load platform plugin "xcb"'
I've built a static version of Qt 5 from Git, but all of the applications I build, including the Qt examples, will immediately quit with the following message:
@Failed to load platform plugin "xcb". Available platforms are:
The program has unexpectedly finished.@
Here's the call to configure I used when building:
./configure -release -static -opensource -nomake examples -nomake tests -xcb
Qt builds successfully, and at this point I'm quite sure I've installed all of the necessary libraries, particularly the xcb-dev libraries.
I've been searching around extensively looking for a solution to this problem. In particular, I came across these:
None have helped.
I've tried several different attempts at building Qt5, but as long as it's static, I get this problem. (If I build without the -static flag my apps will run.)
I've tried adding:
QTPLUGIN += xcb
to my project file, but it makes no difference. As per the suggestion in bug 24496 I've also tried adding the following to main.cpp:
but that just results in the following link error:
undefined reference to `qt_static_plugin_QXcbIntegrationPlugin()'
I'm at my wit's end now - I have no idea how to resolve this, and it's important I be able to use a statically built Qt5 if I'm going to proceed with what I'm doing. From the looks of those bug reports, a lot of people had a problem just like this or similar, but according to the bug reports, it's now resolved. What can I do from here?
I just tried again with RC1, but still the same situation. Is there anyone here that can help me with this?
Did you "file a bug report":https://bugreports.qt-project.org/ ?
The bug tracker is the authority on issues in Qt... anything reported anywhere else on the net is very likely to just get lost in the noise.
[quote author="Tobias Hunger" date="1355006667"]The bug tracker is the authority on issues in Qt... anything reported anywhere else on the net is very likely to just get lost in the noise.[/quote]
Thanks for the tip. I'll make a bug report.