Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Remove libwayland dependency on project



  • Hello,

    I have written a C++ QT program which builds up on QT5.9.5.

    Whenever I compile the program for Linux (amd64), it is linked agains:

    • libwayland-client.so.0
    • libwayland-server.so.0

    I do not see the word "wayland" anywhere during the compile / linking process. So I strongly assume that it is somehow linked indirectly by QT5.9.5. I have analyzed the binary file using "ldd".

    However, I do not need it.

    The question now is, how can I get rid of this linkage?
    I have a QT .pro file and standard QT5.9.5 installed on my machine.

    Is there a switch like:
    QT -= wayland

    I can use in my .pro file for that?

    And if yes, where can I find all possible switches for QT? This must be somewhere in the QT documentation, but I am not able to find it.

    Thank you! Kind Regards,
    W


  • Moderators

    @W-U said in Remove libwayland dependency on project:

    Is there a way to install "qt5.9.5" from official binaries without wayland support, but only X11 maybe?

    dont think so. you will have to compile Qt yourself.

    @JoeCFD
    it doesnt matter what the current runtime environment is. The lib is linked against libwayland, thats it.


  • Moderators

    @W-U
    if you check with ldd the wayland dependency might also come from another dependency.
    For example libQt5Gui.so might already have the dependency, because it was configured this way? So check each dependency libs for their dependencies.

    Try readelf -d myApp | grep NEEDED to show the direct dependencies.



  • Ok, yes. I thought about that also.
    It seems that libQt5WebEngine.so uses for example wayland.

    Is there a way to install "qt5.9.5" from official binaries without wayland support, but only X11 maybe?



  • check if you are using wayland. If x11 is used, wayland lib is not needed.
    echo $XDG_SESSION_TYPE

    also it could be the case that qt was installed under wayland. Then you switched to x11. If yes, purge qt and reinstall in under x11.


  • Moderators

    @W-U said in Remove libwayland dependency on project:

    Is there a way to install "qt5.9.5" from official binaries without wayland support, but only X11 maybe?

    dont think so. you will have to compile Qt yourself.

    @JoeCFD
    it doesnt matter what the current runtime environment is. The lib is linked against libwayland, thats it.



  • Ok. Yes, compiling QT5 on my own without wayland would be a solution, although a bit inconvinient one. Nevertheless, I will try it!

    Thank you all!


Log in to reply