[Development] Qt Static Package

Khuram Ali khuram.ali at aim.com
Sat Apr 20 22:02:51 CEST 2019

I have already installed the dependencies list from Jeff Tranter. However, it doesn't help. The only difference between your ./config command and mine is that, i am also linking openssl. The error remain same. 
Regards,Khuram Ali

-----Ursprüngliche Mitteilung-----
Von: Carlos Enrique Pérez Sánchez <ceperez1996 at gmail.com>
An: Khuram Ali <khuram.ali at aim.com>; development <development at qt-project.org>
Verschickt: Sa, 20. Apr. 2019 1:43
Betreff: Re: [Development] Qt Static Package

As Thiago said:
Please note the -qt-zlib option and family: if you choose to use the bundled 
versions from Qt, you'll need to monitor those upstreams for security issues 
and, if any is found, rebuild your application after applying the fix to the 
sources bundled in Qt.

Far better to use -system-zlib and family.

However, I faced the same problem time ago. I solved it by installing the following dependencies with the `sudo apt install command` bellow:
```Install dependences (thanks to Jeff Tranter): (you may already have most of them installed):

sudo apt install build-essential perl python ruby bison flex gperf libasound2-dev libatkmm-1.6-dev libbz2-dev libcap-dev libcups2-dev libdrm-dev libegl1-mesa-dev libglu1-mesa-dev libfontconfig1-dev libfreetype6-dev libgcrypt11-dev libgcrypt20-dev libgstreamer1.0-dev libicu-dev libnss3-dev libpci-dev libpulse-dev libssl-dev libudev-dev libx11-dev libx11-xcb-dev libxcb-composite0 libxcb-composite0-dev libxcb-cursor-dev libxcb-cursor0 libxcb-damage0 libxcb-damage0-dev libxcb-dpms0 libxcb-dpms0-dev libxcb-present-dev libxcb-present0 libxcb-randr0 libxcb-randr0-dev libxcb-record0 libxcb-record0-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-render0 libxcb-render0-dev libxcb-res0 libxcb-res0-dev libxcb-screensaver0 libxcb-screensaver0-dev  libxcb-shape0 libxcb-shape0-dev libxcb-shm0 libxcb-shm0-dev libxcb-sync-dev libxcb-sync1 libxcb-util-dev libxcb-util0-dev libxcb-util1 libxcb1 libxcb1-dev libxcb-xf86dri0 libxcb-xf86dri0-dev libxcb-xfixes0 libxcb-xfixes0-dev libxcb-xinerama0 libxcb-xinerama0-dev libxcb-xkb1 libxcb-xkb-dev  libxcb-xtest0 libxcb-xtest0-dev  libxcb-xv0 libxcb-xv0-dev libxcb-xvmc0 libxcb-xvmc0-dev libxcomposite-dev  libxcursor-dev libxdamage-dev libxext-dev  libxfixes-dev libxi-dev libxrandr-dev libxrender-dev libxslt1-dev libxss-dev libxtst-dev

NOTE: Jeff Tranter is a Qt Consulting Manager at ICS. Jeff oversees the architectural and high-level design of software systems for clients. Jeff’s leadership organizes global teams of developers on desktop and embedded applications.
El vie., 19 abr. 2019 a las 3:43, Khuram Ali (<khuram.ali at aim.com>) escribió:

Thank you very much Carlos. However, i have got below error when i tried to configure it on Ubuntu 18.04, 
ERROR: Feature 'xcb' was enabled, but the pre-condition 'features.thread && features.xkbcommon && libs.xcb' failed.
What i am missing?
Regards,Khuram Ali

-----Ursprüngliche Mitteilung-----
Von: Carlos Enrique Pérez Sánchez <ceperez1996 at gmail.com>
An: development <development at qt-project.org>
Verschickt: Fr, 19. Apr. 2019 2:14
Betreff: Re: [Development] Qt Static Package

Alexander Nassian:

There are many ways that are much better and do not have the problems static linking involves.

Many ways much better?Static linking is the recommended approach on Linux. And the people from the company uses static linking to build some Qt tools for linux (I have already checked that).

Why should anyone recommend static linking for applications that use Qt? What should the advantages be? TQC would probably, with their posionous view on L-GPL usage.
 Static linking is indeed an interesting topic when we take licenses into account. And that is something that is already documented in Qt Help. However I think that with the resource system and with the "new" QML engine that can get the QML files from resources, the problems of static linking are no much different from the problems of dynamic linking, taking in account that all data in dynamic linking eighter is binary or can be embedded as a binary resource.
I recommend static linking because:1. The size of the application is less than the overall size of app+libs+etc in dynamic linking.2. The deployment process is cleaner, easier, simpler.3. You end with a lot less dependencies issues on Linux.4. You can make your own custom installer for a specific application.
The use case of installers is indeed a point: you can't have an installer that links dynamically. Qt Installer Framework has some issues concerning offline updates, and many people have migrate to other installer frameworks like NSIS, but they are usually not cross-platform or ugly, or no intuitive. Qt Inst. Frw. is built statically, but it uses Qt Widgets. Just Imagine a fluid UI on Qt Installer Framework using Qt Quick Controls 2. That will provide the best UX possible. It must be built against a static version of Qt. I don't know if they have done so or not, but I can't statically link with QQC2 (and I have been trying for 2 years), so building Qt Statically must be, at least, well documented.
The issue is classified as P2 (important), and they assignee agree about providing static packages on the online installer.

Better yet: instead of upvoting, omeone post the full command-line that 
produces a working build.

I agree, Thiago. But the issue is classified as P2, so I think that, at least, they will try. My best command line result is:
For LINUX:  
```./configure -prefix "/somePath/Qt512Static" -static -release -opensource -confirm-license -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -fontconfig -qt-xcb -opengl desktop -sql-sqlite -make libs -make tools -nomake examples -nomake tests -skip qtwebengine
```configure -prefix "C:/somePath/QtStatic" -static -static-runtime -release -opensource -confirm-license -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -opengl desktop -sql-sqlite -qt-freetype -make libs -make tools -nomake examples -nomake tests -skip qtwebengine```
Sadly that does not work well with the QQC2 module (mainly under Windows), as applications shows no effects (elevation, shadows, etc). It may be a linking problem (I hope so) or maybe a problem with the Qt Graphical Effects module. Not sure.
El dom., 14 abr. 2019 a las 19:47, Carlos Enrique Pérez Sánchez (<ceperez1996 at gmail.com>) escribió:

What do people think about providing official static packages?
The reason is that the distribution of an application is much easier in a single executable. For that reasons I've made many static qt builds and it's always a lot of work to make it running.I have success in building qt statically for console and widgets applications, but I have not success on building Qt Quick Controls 2 applications statically, mainly on Windows, because the graphics effects are off, no shadows, no layer, no elevation, etc.
There internet is full of people trying to build Qt statically, because Qt Docs lacks information about building static packages and there are not examples of commands to pass to configure. People even migrated to other frameworks because they like static applications, and in Qt doing that is always a pain.

There is a Jira suggestion:https://bugreports.qt.io/browse/QTBUG-72810
Please give an upvote there it if you agree.

Development mailing list
Development at qt-project.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20190420/98322630/attachment.html>

More information about the Development mailing list