Creating a binary dependant on Qt 5 - qt

I created a development environment with Fedora 18 and Qt 5
When I compile my app it will be 64 bit, and depend on Qt 5. After some research it seems that will be a problem since Centos 6.x is still dependong on Qt 4.6, and Centos 5.x is dependant on earlier Qt, and I'm guessin Ubuntu has its own package limitations.
Is there a "safe" version of Qt I can compile against to ensure it runs everywhere? If not, how can I expect customers to run my program?

If you want to target Linux, then I would recommend using Qt 4.8 (available on most of the Linux Distros), forget about Qt 5 for a year or so. Hardly any Linux distro other than Ubuntu 13.04 and above comes with Qt 5.
Secondly, as far as compiling is considered, if you wish to target Linux distros other than Ubuntu and Fedora than never use Ubuntu or Fedora for compilation. These are bleeding edge Linux distros which include new libraries without much testing. You will not only face the problem of old Qt versions in some Linux distros as you will face the bigger problem of glibc (C library). Make sure the Linux distro you use for compilation has a minimum possible glibc version for Qt 4.8, otherwise even if any Linux distro has Qt 4.8 installed, but has a lower version of glibc, you app still won't run. You can check out distrowatch.com to find out glibc and Qt versions for any Linux Distro
Example:
I compiled my app on Ubuntu 12.04, Qt 4.8.1 with glibc v 2.16 (perhaps). I got a bug report than application does not run on CrunchBang which also has Qt 4.8.1 available but since it is a Debian unstable Linux Distro it uses glibc v2.13. Since that day I always compile my application on CrunchBang (very lighweight, you can Virtual Box for this) and hardly some one complains now.
As far as CentOs is considered, you will need to recompile your code on CentOS.

Related

QT version seems to be older than installed

I'm new to QT and QML, I found a cool KDE Plasma addon on the internet and wanted to edit it, but flushMode property, which I want to use, was introduced in QT 5.13. I have installed QT 5.15 (to be exact, 5.15.3), rebooted and got file:///filename.qml:58:2: "VideoOutput.flushMode" is not available in QtMultimedia 5.8. I also checked that qt5-multimedia is 5.15.3+kde+r0-1 (latest from arch linux repository), checked the QT version in system settings, everything says it's 5.15, but in the logs it acts like it's 5.8. Is it possible that I have 2 different qt5 installations, or why does this happen?
Yes, you very likely have two Qt installed. You got system Qt package that comes with desktop environment, I believe it does not include development files (headers), to obtain them you installed qt-something-dev package that installed another Qt as dependency.

Install Qt5.8 libraries on Ubuntu 14 x86_64

I want to run a program which needs Qt5.8 libraries, and the underlying OS is Ubuntu 14.05.5 LTS
This OS seems to include a prebuilt package for Qt 5.2.1 and nothing later in the repos.
Can I safely add Qt5.8 libraries? How would I do so? (I can only find instructions for installing the full Qt IDE)

How to build 32-bit Qt5 application on 64-bit Ubuntu

I have currently got the 64-bit version of Qt5 installed on a 64-bit Ubuntu machine but I'd also like to be able to do 32-bit builds on the same machine. On Windows I can simply select additional kits in the MaintenanceTool but on Linux this doesn't seem to be possible. Or am I missing something?
Three steps:
Get the 32 bit version from Qt or build from source with ./configure -platform linux-g++-32.
Make sure it gets installed to a different path than the 64-bit version. Can be achieved with something like ./configure -platform linux-g++-32 -prefix /opt/qt32 or the path that feels comfortable to you.
Fix compiler settings along these lines for building the application

How do I create my .run file to install Qt 5.9.0 on 32-bit debian?

As per my information, Binaries (or offline/online installers) for installing Qt (>= 5.6) on 32-bit linux are not provided. For example, If I want to use Qt 5.9.0 on 32-bit linux (debian, specifically), the only option is to download Qt source and build it. I have successfully built Qt 5.9.0 on my 32-bit linux machine. But I have to do this on all my development PC's. Instead if I can build it once and create an installer somehow, that will save a lot of time. Is there a way to create offline installer (e.g. *.run files) for installing Qt 5.9.0 on 32-bit Linux (e.g. debian)?
As stated by #Velkan, Qt is available on 32 bit Debian from the official repos.
But, indeed, there is no 32-bit Linux installer from the Qt project.
Regarding copying a Qt install from a Debian PC to another, you do not need to create an installer. Just copy/tar/zip the directory in which Qt is installed. The only requirement is that you must keep the installation in the same absolute path as the Qt Core library has the path hardcoded in it and it is use for plugin detection.
NB1: It is possible to patch Qt Core library to change the hardcoded path and even make it relative. It is not officially documented but you can take a look in the sources of tools like windeployqt or the online installer
NB2: Do not use Qt 5.9.0, prefer 5.9.2. Both are forward and backward binary compatible, but the latter received bug fixes.

QT 5.2 has no kit or qmake with MingW after installation

I downloaded the QT 5.2 build for MingW/OpenGL build and installed it. When I run QTCreator and try to create a project, I can't set it up because there is no kit available to choose from. I have MingW installed, so I tried to point QT to this installation, but there is qmake as well missing. I'm not sure if the manual configuration of the compiler would suffice to have a kit to choose from, but that would be my expectation.
So the question is, how do I setup QT properly that it recognizes my MingW installation and how do I get qmake to continue with QT? After downloading a 600MB package I would have expected that it works out of the box.
OS is Windows 7 and my MingW uses gcc 4.8 so it should be the same version that QT brings in it's package as well.

Resources