Page 1 of 3 123 LastLast
Results 1 to 10 of 28

Thread: qt version problem

  1. #1
    Join Date
    Mar 2015
    Location
    Viçosa, Brasil
    Posts
    263

    Exclamation qt version problem

    Hi,

    I need to use qt5, in my system:

    Code:
    viniciusbr@linux-wu6s:~> qmake --version
    QMake version 2.01a
    Using Qt version 4.8.6 in /usr/lib64
    But I have the qt5 installed. So, I tried to update the alternatives, but there is something wrong:

    Code:
    viniciusbr@linux-wu6s:~> sudo update-alternatives --install "/usr/bin/qmake" "qmake" "/usr/bin/qmake-qt5" 60
    root's password:
    update-alternatives: warning: forcing reinstallation of alternative /usr/bin/qmake-qt5 because link group qmake is broken
    update-alternatives: warning: not replacing /usr/bin/qmake with a link
    What can I do?
    --
    Biostatistics and Data Science
    https://bio-data.github.io/

  2. #2

    Default Re: qt version problem

    Quote Originally Posted by viniciusbrbio View Post
    But I have the qt5 installed. So, I tried to update the alternatives, but there is something wrong:

    Code:
    viniciusbr@linux-wu6s:~> sudo update-alternatives --install "/usr/bin/qmake" "qmake" "/usr/bin/qmake-qt5" 60
    root's password:
    update-alternatives: warning: forcing reinstallation of alternative /usr/bin/qmake-qt5 because link group qmake is broken
    update-alternatives: warning: not replacing /usr/bin/qmake with a link
    qmake is not handled by update-alternatives.

    What can I do?
    Run "qmake-qt5" instead, if you want to use Qt5.
    Or add the result of the command "qtpaths --binaries-dir" to the path, before /usr/bin/.

    Alternatively, you could also create a symlink called "qmake" (that points to /usr/bin/qmake-qt5 or $(qtpaths --binaries-dir)/qmake) in /usr/local/bin/ (or ~/bin), if you want to override qmake in general.

  3. #3
    Join Date
    Mar 2015
    Location
    Viçosa, Brasil
    Posts
    263

    Default Re: qt version problem

    Hi!

    So:

    Code:
    viniciusbr@linux-wu6s:~> qtpaths --binaries-dir
    /usr/lib64/qt5/bin
    Then:

    Code:
    sudo update-alternatives --install "/usr/bin/qmake" "qmake" "/usr/lib64/qt5/bin/make-qt5" 60
    Is it?
    --
    Biostatistics and Data Science
    https://bio-data.github.io/

  4. #4
    Join Date
    Mar 2015
    Location
    Viçosa, Brasil
    Posts
    263

    Default Re: qt version problem

    I did it:

    Code:
    sudo update-alternatives --install /usr/lib64/qt5/bin/qmake-qt5 qmake-qt5 /usr/bin/qmake-qt5 60
    But I think that is wrong once:

    Code:
    viniciusbr@linux-wu6s:~> sudo update-alternatives --config qmake
    There are 2 choices for the alternative qmake (providing /usr/lib64/qt5/bin/qmake).
    
    
      Selection    Path                          Priority   Status
    ------------------------------------------------------------
    * 0            /usr/lib64/qt5/bin/qmake-qt5   60        auto mode
      1            /usr/bin/qmake-qt5             60        manual mode
      2            /usr/lib64/qt5/bin/qmake-qt5   60        manual mode
    
    
    Press <enter> to keep the current choice[*], or type selection number: 2
    viniciusbr@linux-wu6s:~> qmake --version
    QMake version 2.01a
    Using Qt version 4.8.6 in /usr/lib64
    --
    Biostatistics and Data Science
    https://bio-data.github.io/

  5. #5

    Default Re: qt version problem

    Quote Originally Posted by viniciusbrbio View Post
    Then:

    Code:
    sudo update-alternatives --install "/usr/bin/qmake" "qmake" "/usr/lib64/qt5/bin/make-qt5" 60
    Is it?
    No.
    Again, qmake is not managed by update-alternatives.

    /usr/bin/qmake is the Qt4 version, and you cannot change that. (well, you can, but updates will revert your change)

    Also, /usr/lib64/qt5/bin/ contains both "qmake" and "qmake-qt5" (the latter points to the former). The symlink in /usr/bin/ has been renamed to not conflict with Qt4.

    Again, if you want to refer to the Qt5 version as "qmake" (instead of "qmake-qt5"), you'd need to add /usr/lib64/qt5/bin/ to the path (before /usr/bin/, so that the qmake from there will be preferred), or add a symlink to /usr/local/bin/ or ~/bin/ (both are preferred over /usr/bin/ by default).

    E.g.:
    Code:
    export PATH="/usr/lib64/qt5/bin/:$PATH"
    or
    Code:
    sudo ln -s /usr/bin/qmake-qt5 /usr/local/bin/qmake
    or
    Code:
    sudo ln -s /usr/lib64/qt5/bin/qmake /usr/local/bin/
    Or just run qmake-qt5 instead of qmake.
    Last edited by wolfi323; 09-May-2017 at 03:00.

  6. #6

    Default AW: Re: qt version problem

    Quote Originally Posted by viniciusbrbio View Post
    I did it:

    Code:
    sudo update-alternatives --install /usr/lib64/qt5/bin/qmake-qt5 qmake-qt5 /usr/bin/qmake-qt5 60
    But I think that is wrong once:
    Yeah, you created your own qmake-qt5 now, managed by update-alternatives.
    But that won't change /usr/bin/qmake...
    (and that change will also be reverted by updates)

  7. #7
    Join Date
    Mar 2015
    Location
    Viçosa, Brasil
    Posts
    263

    Default Re: qt version problem

    Yah, but didn't work. Because when I tried to run the application:

    Code:
    viniciusbr@linux-wu6s:~/Downloads/RANA> make
    g++ -c -pipe -Wextra -Wno-unused-variable -Wno-unused-parameter -O2 -o3 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/default -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include -I/home/viniciusbr/Downloads/RANA/../lua51_64bit/include -I/usr/include/luajit-5_1-2.0 -I. -I. -o main.o main.cpp
    In file included from mainwindow.h:35:0,
                     from main.cpp:26:
    control.h:27:42: fatal error: QtConcurrent/qtconcurrentrun.h: Arquivo ou diretório não encontrado
     #include <QtConcurrent/qtconcurrentrun.h>
                                              ^
    compilation terminated.
    Makefile:444: recipe for target 'main.o' failed
    make: *** [main.o] Error 1
    --
    Biostatistics and Data Science
    https://bio-data.github.io/

  8. #8

    Default Re: qt version problem

    PS, it would of course also work to create a shell alias:
    Code:
    alias qmake=qmake-qt5
    Then the shell would actually run qmake-qt5 if you enter qmake.

  9. #9

    Default Re: qt version problem

    Quote Originally Posted by viniciusbrbio View Post
    Yah, but didn't work. Because when I tried to run the application:

    Code:
    viniciusbr@linux-wu6s:~/Downloads/RANA> make
    g++ -c -pipe -Wextra -Wno-unused-variable -Wno-unused-parameter -O2 -o3 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/default -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include -I/home/viniciusbr/Downloads/RANA/../lua51_64bit/include -I/usr/include/luajit-5_1-2.0 -I. -I. -o main.o main.cpp
    In file included from mainwindow.h:35:0,
                     from main.cpp:26:
    control.h:27:42: fatal error: QtConcurrent/qtconcurrentrun.h: Arquivo ou diretório não encontrado
     #include <QtConcurrent/qtconcurrentrun.h>
                                              ^
    compilation terminated.
    Makefile:444: recipe for target 'main.o' failed
    make: *** [main.o] Error 1
    You may also have to restart the shell, it may have cached the qmake lookup result to use /usr/bin/qmake instead of the new /usr/local/bin/qmake.

  10. #10

    Default Re: qt version problem

    Oh, and if you already tried to build using qmake (Qt4), you have to clean out the build folder first (and rerun qmake) before you try again.
    Just running make will use the already generated Makefiles that refer to Qt4...

Page 1 of 3 123 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •