开发者

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 applica开发者_如何学运维tions still use Qt 4.7.2. Is it possible? If it is, how to do it then?


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.


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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜