Handle Qt programs for different Qt versions on one machine



  • How could we manage applications related to different machines on one machine?

    Lets say:

    • App1 needs Qt 5.3
    • App2 needs Qt 5.3
    • App3 needs Qt 5.3
    • App4 needs Qt 5.6
    • App5 needs Qt 5.6

    That means want just ONE Qt5.3 installations set and ONE für 5.6. How to set the paths for the apps?


  • Qt Champions 2016

    Hi
    can you put app 1,2,3 in same deploy folder ?
    and 4,5 in other?

    If on windows, the Operating system will look for the dlls near
    the exe. So sharing the dlls are not so easy.

    On linux, u can use rpath

    http://doc.qt.io/qt-5/windows-deployment.html
    http://doc.qt.io/qt-5/linux-deployment.html


  • Qt Champions 2016

    @Soeren
    Hello,
    Qt is binary compatible, so you actually only need one distribution of Qt 5.6 to run all of your listed (5) programs.



  • I use a batch file and command console shortcut. As long as the appropriate variables are set you can have as many versions of Qt that you want.

    Startup Batch File contents.
    This sets a few Qt variables and also defines the locations of the various Qt tools and GCC folder.

    @set PATH=C:\qt\5.6.0\qtbase\bin;C:\qt\mingw482_32\bin;C:\msys\bin;C:\Program Files\CMake\bin;%PATH%
    @set QMAKESPEC=win32-g++
    @set QTDIR=C:\qt\5.6.0
    
    @ECHO INF:  Console configured for Qt 5.6.0
    
    @CD /D "c:\MyProjects"
    
    

    Startup Shortcut for Command Console.
    This is a regular windows shortcut you create on the desktop or wherever you want. It will startup the command console (cmd.exe) and run the startup batch file shown above. The 'target' and 'start in' entries are shown below for what I use.

    target: %COMSPEC% /K "C:\qt\QT5_SETUP.BAT"
    start in: %windir%
    
    

    Note: If you only use the command console this should work very well. If you need something more (like an IDE) this part could be a bit of an issue.

    Note: If you used an installer that setup the Windows environment variables you might want to review those settings as this will likely interfear with this method.



  • Thanks for your replies. It turns out that we cannot build a no static version of Qt with static runtime :-(


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.