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. QMake -v pointing to the wrong directory
QtWS25 Last Chance

QMake -v pointing to the wrong directory

Scheduled Pinned Locked Moved Installation and Deployment
qmakeqtcreatorpath
10 Posts 3 Posters 7.2k Views
  • 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.
  • A Offline
    A Offline
    AQTStudent
    wrote on last edited by
    #1

    Hello,
    I am following the tutorial of how to build qt creator from git on my linux vmware machine.
    http://wiki.qt.io/Building-Qt-Creator-from-Git
    I come to the first step: qmake -v
    My output of qmake -v is different..

    • root@ubuntu:/home/jorricks/qt5/qtbase/bin# qmake -v
      QMake version 3.0
      Using Qt version 5.3.0 in /usr/lib/i386-linux-gnu
      root@ubuntu:/home/jorricks/qt5/qtbase/bin# ./qmake -v
      QMake version 3.0
      Using Qt version 5.4.2 in /home/jorricks/qt5/qtbase/lib

    Of course I want to use the 5.4.2...
    My $PATH

    • root@ubuntu:/home/jorricks/qt5/qtbase/bin# echo $PATH
      /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/jorricks/qt5/qtbase/bin

    Does anyone have any suggestions for me?

    Kind regards,

    simowS 1 Reply Last reply
    0
    • A AQTStudent

      Hello,
      I am following the tutorial of how to build qt creator from git on my linux vmware machine.
      http://wiki.qt.io/Building-Qt-Creator-from-Git
      I come to the first step: qmake -v
      My output of qmake -v is different..

      • root@ubuntu:/home/jorricks/qt5/qtbase/bin# qmake -v
        QMake version 3.0
        Using Qt version 5.3.0 in /usr/lib/i386-linux-gnu
        root@ubuntu:/home/jorricks/qt5/qtbase/bin# ./qmake -v
        QMake version 3.0
        Using Qt version 5.4.2 in /home/jorricks/qt5/qtbase/lib

      Of course I want to use the 5.4.2...
      My $PATH

      • root@ubuntu:/home/jorricks/qt5/qtbase/bin# echo $PATH
        /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/jorricks/qt5/qtbase/bin

      Does anyone have any suggestions for me?

      Kind regards,

      simowS Offline
      simowS Offline
      simow
      wrote on last edited by simow
      #2

      @jorricks Hi, I think you are running Qt 5.3.0 as your system Qt and as it seems you built 5.4.2 and installed it in your home directory. But your PATH references your system Qt first. Try putting /home/jorricks/qt5/qtbase/bin first in your PATH:

      export PATH=$HOME/qt5/qtbase/bin:$PATH
      

      Let's Try To Negotiate!

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

        Hi,

        If you want to call the qmake from your current path (/home/jorricks/qt5/qtbase/bin) you need to add ./ before so:

        root@ubuntu:/home/jorricks/qt5/qtbase/bin# ./qmake -v
        will show you the correct version.

        I'd avoid modifying PATH since you could end up having more version of Qt on your system. You should rather use the full path to qmake, so you know you are using the one you want to currently use.

        On a side note, developing as root is pretty dangerous, you can annihilate your system without knowing and you won't get any warning.

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

        simowS A 2 Replies Last reply
        1
        • SGaistS SGaist

          Hi,

          If you want to call the qmake from your current path (/home/jorricks/qt5/qtbase/bin) you need to add ./ before so:

          root@ubuntu:/home/jorricks/qt5/qtbase/bin# ./qmake -v
          will show you the correct version.

          I'd avoid modifying PATH since you could end up having more version of Qt on your system. You should rather use the full path to qmake, so you know you are using the one you want to currently use.

          On a side note, developing as root is pretty dangerous, you can annihilate your system without knowing and you won't get any warning.

          simowS Offline
          simowS Offline
          simow
          wrote on last edited by simow
          #4

          @SGaist

          I'd avoid modifying PATH since you could end up having more version of Qt on your system. You should rather use the full path to qmake, so you know you are using the one you want to currently use.

          Admittedly one should know what she/he is doing. But that said qtchooser comes to my mind (http://code.qt.io/cgit/qt/qtchooser.git/). It uses the version one can set via the QT_SELECT environment variable.
          Should be a standard package that comes with the distro.

          Let's Try To Negotiate!

          1 Reply Last reply
          1
          • simowS simow

            @jorricks Hi, I think you are running Qt 5.3.0 as your system Qt and as it seems you built 5.4.2 and installed it in your home directory. But your PATH references your system Qt first. Try putting /home/jorricks/qt5/qtbase/bin first in your PATH:

            export PATH=$HOME/qt5/qtbase/bin:$PATH
            
            A Offline
            A Offline
            AQTStudent
            wrote on last edited by AQTStudent
            #5

            @simow
            This worked perfectly! Thanks!

            simowS 1 Reply Last reply
            1
            • A AQTStudent

              @simow
              This worked perfectly! Thanks!

              simowS Offline
              simowS Offline
              simow
              wrote on last edited by
              #6

              @jorricks You are welcome.

              Let's Try To Negotiate!

              1 Reply Last reply
              1
              • SGaistS SGaist

                Hi,

                If you want to call the qmake from your current path (/home/jorricks/qt5/qtbase/bin) you need to add ./ before so:

                root@ubuntu:/home/jorricks/qt5/qtbase/bin# ./qmake -v
                will show you the correct version.

                I'd avoid modifying PATH since you could end up having more version of Qt on your system. You should rather use the full path to qmake, so you know you are using the one you want to currently use.

                On a side note, developing as root is pretty dangerous, you can annihilate your system without knowing and you won't get any warning.

                A Offline
                A Offline
                AQTStudent
                wrote on last edited by AQTStudent
                #7

                @SGaist Okay.. so It didn't really work out after all..
                I was trying to install qt-creator for 5.4.2.
                I edited the path and everywhere qmake -v now points to the right directory..
                However, after installing I looked at help and still qt creator was using qt 5.3...
                How do I make sure my installation is done for 5.4.2??

                • root@ubuntu:/home/jorricks/qt-creator-build# /home/jorricks/qt5/qtbase/lib/qmake -r /home/jorricks/qt-creator/qtcreator.pro
                  bash: /home/jorricks/qt5/qtbase/lib/qmake: No such file or directory

                That was the outcome of the full path as suggested..

                Kind regards,

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

                  The Qt version used to build Qt Creator and the one you are using are two completely different things and don't need to match.

                  So are you building Qt Creator ?

                  Also, are you doing it as root or as your normal user ? It's not really clear.

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

                  A 1 Reply Last reply
                  1
                  • SGaistS SGaist

                    The Qt version used to build Qt Creator and the one you are using are two completely different things and don't need to match.

                    So are you building Qt Creator ?

                    Also, are you doing it as root or as your normal user ? It's not really clear.

                    A Offline
                    A Offline
                    AQTStudent
                    wrote on last edited by
                    #9

                    @SGaist Okay.. So I found out I installed QT5 with apt-get as well..
                    Now I started it from the installed folder and it works.
                    I was indeed building qt creator yes and I was doing everything as root..
                    Everything works now except one thing..
                    The examples in qt creator don't show up and the same for the help..
                    I get this error:

                    • The page could not be found
                      Error loading: qthelp://org.qt-project.qtcreator.3481/doc/index.html
                      Check that you have the corresponding documentation set installed.

                    Kind regards,

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

                      Is it an error from a self built Qt ?

                      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

                      • Login

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