Mitu
Mitu

Reputation: 51

How to install two versions of Qt and tell the application which to use?

I am developing an application in Qt, but using D language (with QtD binding). I've noticed that my app crashes with Qt 4.7.x, so I need to use Qt 4.6.2 instead. However in my system Qt 4.7.2 is installed. Unfortunately I neither make QtD work with the latest Qt versions nor (I'm afraid) count on QtD developers...

The only thing I need to make my application install in system Qt 4.6.2 libs and use it, but let all the other applications still use Qt 4.7.2. Is it possible? If it is, how to do it then?

Upvotes: 5

Views: 1627

Answers (2)

JadziaMD
JadziaMD

Reputation: 2760

The answer to your question is the version of Qt is determined by the qmake you use to generate your Makefile.

/opt/QtSDK/Qt-4.6.2/bin/qmake

/opt/QtSDK/Qt-4.7.3/bin/qmake

Each will use the library in the directory.

Upvotes: 5

weekens
weekens

Reputation: 8292

It is possible to install several versions of the library into one system, and all package managers (rpm, deb) support this out of the box.

These libraries will be just differently named. For example, if id do

ls /usr/lib/ | grep libcurl

on my system, I'll get:

libcurl-gnutls.so.3
libcurl-gnutls.so.4
libcurl-gnutls.so.4.2.0
libcurl.so.3
libcurl.so.4
libcurl.so.4.2.0

, so, different version of the same library happily live together.

All you need to do is to link against the desired version of QT library. You need to sepcify it in linker options (don't remember the exact option).

Upvotes: 1

Related Questions