-1

I install the latest qt version from the official website http://www.qt.io/qt5-4/ successfully. I follow this tutorial http://sysads.co.uk/2014/05/install-qt-5-3-ubuntu-14-04 and install the qt 5.4 version. Besides, I have the Ubuntu repository version of qt 5.2.1 installed.

Now I want to make the default version of 5.4 due to a program can't work well in the old qt5 version. That is to say, when I start a program which need to use qt5 library the program will use the version 5.4 rather than the version qt 5.2. Though I have installed the version 5.4 and 5.2, the program still use qt 5.2 version.

I try to use qtchooser to choose the 5.4 version as the default option, however, the program installed in the system still use the qt 5.2 library. I endeavor to modify the related files regarding qtchooser, nothing changes.

jack_001
  • 1
  • 1
  • 7

2 Answers2

1

If the library version is not in some regular repository, I would strongly suggest not relying on the user to install it somehow from an "unofficial" install location. Or provide a package for the library version yourself to install alongside your application. But don't replace the system Qt version. That would be Bad®.

Instead, either compile your program with a specific rpath, or wrap your program in scripts that use something like LD_PRELOAD and/or LD_LIBRARY_PATH to load the library version you're shipping in your application package.

Both ways are clunky, and I would try to at least work around the Qt version bug if at all possible.

rubenvb
  • 74,642
  • 33
  • 187
  • 332
  • Thank you for your response. The second method I have tried before doesn't work very well. https://github.com/xylosper/bomi/issues/296 The author's suggestion is to use the latest version to resolve the problem. I try to use LD_LIBRARY_PATH=/path/to/new/Qt/libs/directory bomi, indeed it can exit full-screen but it can't show any images of the videos. Besides, I am sure that the bomi works well except the full-screen bug in the default Ubuntu repository version 5.2 – jack_001 Oct 15 '15 at 07:52
  • If you can't show images of videos, you may have misconfigured Qt and caused it to miss a plugin or media library. Try to find a newer Qt version in a prerelease of Ubuntu, and see what options they use to build it. That might resolve the issue. – rubenvb Oct 15 '15 at 07:58
  • misconfigure Qt? What do you refer to? the bomi program or the Qt installation? – jack_001 Oct 15 '15 at 08:06
  • I was referring to Qt itself. This is an educated guess, as I have no idea why there are no "images of the videos" showing. Try debugging that at least if you want to know why that might not be working when using the Qt libraries you built. – rubenvb Oct 15 '15 at 08:10
0

The latest Qt version (non-alpha) actually is Qt 5.5.

If you install it through the installer provided by Qt, you should change the default Qt version by editing/creating:

/etc/xdg/qtchooser/default.conf

which should contain first the bin directory, then the lib directory, for example:

/opt/Qt/5.5/gcc_64/bin
/opt/Qt/5.5/gcc_64/lib

At least this works for the qmake version. Otherwise you might need to change LD_LIBRARY_PATH as commented by rubenvb.

agold
  • 6,140
  • 9
  • 38
  • 54
  • Thanks. I have tried this method to change the default version as mentions in the question. Indeed it works for qmake version but it can't work in the installed problem which use qt library from my test. – jack_001 Oct 15 '15 at 07:59