Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. How to set a default Qt version in Linux?
Forum Updated to NodeBB v4.3 + New Features

How to set a default Qt version in Linux?

Scheduled Pinned Locked Moved Installation and Deployment
4 Posts 3 Posters 11.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    ViniciusCampanha
    wrote on last edited by
    #1

    Hello,

    I have Qt4 and Qt5 installed in my Ubuntu and, in Qt Creator I can easy manage which one will be used, but how to choose one of them to be the default in command line?
    The default in command line is Qt5, I want to change it to Qt4.

    Thanks!

    1 Reply Last reply
    0
    • V Offline
      V Offline
      ViniciusCampanha
      wrote on last edited by
      #2

      Hello,

      I have uninstalled the package Qt5-default, with apt-get remove, and it automatically installed the Qt4-default package.
      Now in terminal, if I call qmake --version or qmake -query QT_VERSION, it shows me he is ysing Qt 4.

      So, I assume I can change the default Qt by installing the Qtx-defaul package, but have another way? Some way without internet or apt-get?

      Thanks!

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        I don't know if it's provided, but have a look at the update-alternatives command

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tobias.hunger
          wrote on last edited by
          #4

          To develop on the command line: Just use the qmake that comes with the Qt package you want to use. I am no ubuntu expert, but usually that binary is in some -dev or -devel package.

          To switch Qt versions that are loaded when starting applications you might need to point the environment variable LD_LIBRARY_PATH to wherever the relevant .so files are located. This may or may not be necessary, depending on your system setup.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved