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)
Related
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.
On my Ubuntu 16.04, I have some packages installed (through Synaptic) that have QT version 5.5.1. And they seem to be needed by software that I have (TeXstudio, for instance).
But as a developer I am trying to use Qt 5.9.1, which I installed by downloading it from the QT website (like this). But when I run qmake, it runs the wrong version. How can I choose which version I want to use?
$ qmake --version
QMake version 3.0
Using Qt version 5.5.1 in /usr/lib/x86_64-linux-gnu
But I want this one:
~/lib/Qt5.9.1/5.9.1/gcc_64/bin/qmake --version
QMake version 3.1
Using Qt version 5.9.1 in /home/diego/lib/Qt5.9.1/5.9.1/gcc_64/lib
I would like that all that when I'm building software or running software I have built (instead of software installed on the system) it uses 5.9.1. How can I do this?
You should run qmake with its full path:
$ ~/lib/Qt5.9.1/5.9.1/gcc_64/bin/qmake
If you don't want to type full path, you could prepend your local Qt directory to PATH environment variable. In order for runtime linker to find right libraries, you can add Qt directory to LD_LIBRARY_PATH. You could set QTDIR too, so tools like CMake find right Qt:
You could put following line in ~/.bashrc:
export QTDIR="~/lib/Qt5.9.1/5.9.1/gcc_64/"
export PATH="$QTDIR/bin:$PATH"
export LD_LIBRARY_PATH="$QTDIR/lib:$LD_LIBRARY_PATH"
I've recently came to linux from a 1 year Windows run in Qt so I don't know how this works exactly and couldn't find any thing decent. So here it is :
As is obvious from the title I'm trying to install Qt 5.1.1 and Qwt 6.1.0 in Ubuntu 12.04. I have written a project with the same versions in Windows and now I want to run the project in Linux. The problem is I don't know If I'm doing the installing process right!
I installed Qt 5.1.1 in /opt/qt5.1.1 and compiled Qwt 6.1.0 to /usr/local. I copied the files in include, lib, plugin/designer to the related folders in qt 5.1.1. After this the plugin is fine and I can see the .h files when I type include but when I want to run my project I get the error undefined reference to ... for every method or attribute of Qwt library used!
What am I doing wrong here?
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.
How do I build 32-bit Qt under 64-bit Linux? I have trouble with libraries, notably with x11 (“X11 functionality failed” message during configure). What packages do I have to install and what mkspec I have to use? I tried linux-g++-32, is it correct?
Do you have the 32-bit X11 libraries installed? You'll probably have problems linking against 64-bit libraries.