Unsolved QT 6.4.1 build from source. Can't get xcb configured.
-
Hi. On Ubuntu 22.04, in a QT 6.4.1 source directory, I run:
configure -top-level -release -static -opensource -confirm-license -prefix <my prefix>
config.summary shows:
X11 specific:
XLib ................................. yes
XCB Xlib ............................. no
EGL on X11 ........................... yes
xkbcommon-x11 ........................ no
xcb-sm ............................... noI have all the libraries specified in Qt 6.4 Qt for X11 Requirements installed.
When I build an application, the result is a successful build, but upon running I get:qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.I've seen lots of posts about this error but haven't found any that duplicate mine as in not being able to properly configure the plugin on Ubuntu 22.04 with QT 6.4.1
FYI I don't have this problem with QT 6.3.2, it configures, builds and runs fine.
Thanks in advance.
-
@GuitGentlyWeeps said in QT 6.4.1 build from source. Can't get xcb configured.:
I have all the libraries specified in Qt 6.4 Qt for X11 Requirements installed.
No, at least not what configure output tells you:
XCB Xlib ............................. no
x11 & xcb has a lot of libraries - you for sure missed one development package. Take a look into the configure log files (config.log iirc) to see what's exactly missing.
-
@Christian-Ehrlicher
Thanks very much for your reply.
There is no config.log. There is config.summary which I copied and pasted from.
The line that you cited is a build option that is not enabled. The build options for xcb in configure are:-xcb-xlib............. Enable Xcb-Xlib support [auto]
-xcb ............... Enable X11 support [auto] (Linux only)
-bundled-xcb-xinput Use bundled XInput2 support [auto]All are set to auto and again, I've installed all libraries that the documentation asks for. I've even installed:
apt-get install libx11-*
apt-get install libx11*
apt-get install libxcb-*
apt-get install libxcb*
apt-get install libxkbcommon-devsudo
apt-get install libxkbcommon-x11-devjust to make sure that I had everything.
There must be a secret library that I'm not aware of that needs to be installed. FYI on QT 6.3.2, that configures fine and the line in the summary that you cited shows:X11 specific:
XLib ................................. yes
XCB Xlib ............................. yes
EGL on X11 ........................... yes
xkbcommon-x11 ........................ yes
xcb-sm ............................... yesCheers.
-
@GuitGentlyWeeps said in QT 6.4.1 build from source. Can't get xcb configured.:
There is no config.log
It must be there.
You can also pass -v parameter to configure to get more information. -
Thanks. I've configured a ton of iterations with the command line:
./configure -release -static -opensource -confirm-license -prefix ~/Qt/6.4.1/Build-StaticI see no file named config.log.
FYI if I pass a -v option as you've suggested, the result is as follows:
./configure -v -release -static -opensource -confirm-license -prefix ~/Qt/6.4.1/Build-Static
- mkdir -p qtbase
- cd qtbase
- exec /home/myhome/Qt/6.4.1/Src/qtbase/configure -top-level -v -release -static -opensource -confirm-license -prefix /home/myhome/Qt/6.4.1/Build-Static
CMake Error at qtbase/cmake/QtProcessConfigureArgs.cmake:270 (message):
Unknown command line option '-v'.
Call Stack (most recent call first):
qtbase/cmake/QtProcessConfigureArgs.cmake:655 (qtConfAddError)
I feel like there is some disconnect here.
-
The must be a CMakeError.log and CMakeOutput.log somewhere in your build folder
-
Yeah, the error is printed. The cmake file cited in the error printout is merely:
function(qtConfAddError)
message(FATAL_ERROR ${ARGV})
endfunction()And the error it's flagging is what it printed, there is no -v option in the configure script. A run of configure -h will show you that. So the actual problem still remains. I don't want to get off track but can you do a static build of QT 6.4.1 AND run it without the error xcb error?
-
I am concluding that with the instructions given by QT, it is not possible to statically build and deploy a QT application from QT 6.4.1 on Ubuntu 22.04.
-
Don't know about QuickTime Player, but it is certainly possible to build static Qt on Ubuntu 22.04 and successfully use it to build and run application without getting xcb plugin error.
In your case it seems that you just don't have all the required dependencies installed. I see you have a good number of those listed in your post, but still that list isn't compete, at the very least because it is lacking
libglu1-mesa-dev
,libxrender-dev
andlibxi-dev
. Just in case, here's an installation command that should cover everything required:$ sudo apt install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
It might be that there is a bug exactly in Qt 6.4.1, which would also explain why you didn't get this problem with Qt 6.3.2, as you said. I can only state that I've built static Qt 6.5.1 on Ubuntu 22.04 (and also on Arch-based SteamOS 3.4.6) just yesterday, and my Qt-based applications launch just fine.
-
@veryqtperson said in QT 6.4.1 build from source. Can't get xcb configured.:
sudo apt install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
Thanks for that solution, it solved my problem.
I had exactly the same error message as the OP - not exactly very helpful.
I have experienced this before with other versions but generally deleteng all the Qt folders and config files and then re-installing has worked but not this time!What I don't understand is that I had 6.4.3 running perfectly and I could compile and run Qt apps, console apps and QtQuick apps and then after the upgrade Qt suddenly wouldn't run any graphical programs. Console apps were fine.
The first attempt at upgrading, I just told the maintenance tool to delete 6.4.3 and install 6.5.1 so why did those libraries disappear?Very happy that it is all working again now and I will save that command in case I need it next time!
-
@veryqtperson I am also very thankful for this hint. It worked perfectly on Qt 6.7.0 as well.
I was pretty desperate because I'm not used to this problem as a MacOS developer, but had to setup Ubuntu because some PySide6 feature shows a bug on Ubuntu. Now I can debug GUI code on Ubuntu as well.Very happy like @Colins2 :D