Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. How to set compile for qmake
Forum Updated to NodeBB v4.3 + New Features

How to set compile for qmake

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
11 Posts 3 Posters 2.2k Views 3 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.
  • R Offline
    R Offline
    r3d9u11
    wrote on last edited by r3d9u11
    #1

    Hello. I have easy question (maybe): How to specify path to compile for qmake?
    I've set compilers and Qt in my QtCreator, I've have set Prefix in qt.conf.

    But qmake still igone compilers which set in QtCreator and tried to use old invalid path.

    What I'm doing wrong?


    Also how I can specify compilers without QtCreator ?

    Thanks!

    K 1 Reply Last reply
    0
    • R r3d9u11

      Hello. I have easy question (maybe): How to specify path to compile for qmake?
      I've set compilers and Qt in my QtCreator, I've have set Prefix in qt.conf.

      But qmake still igone compilers which set in QtCreator and tried to use old invalid path.

      What I'm doing wrong?


      Also how I can specify compilers without QtCreator ?

      Thanks!

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @r3d9u11

      In creator go to "Tools"->"Options"->"Kits" and check the different tabs for "kits", "Compiler" and "Qt Versions" for special signs in red or yellow.

      When you have all properly installed you have basically to choose the qmake for a specifc Qt version and in most cases you are fine.

      AFAIK you should not make compilers available through general environment settings outside of creator, because this might interfere.

      Vote the answer(s) that helped you to solve your issue(s)

      R 1 Reply Last reply
      2
      • K koahnig

        @r3d9u11

        In creator go to "Tools"->"Options"->"Kits" and check the different tabs for "kits", "Compiler" and "Qt Versions" for special signs in red or yellow.

        When you have all properly installed you have basically to choose the qmake for a specifc Qt version and in most cases you are fine.

        AFAIK you should not make compilers available through general environment settings outside of creator, because this might interfere.

        R Offline
        R Offline
        r3d9u11
        wrote on last edited by r3d9u11
        #3

        @koahnig Hello. Thank for the reply.

        Yes, I've checked and all settings are right:

        • Kits -> Manual -> Compiler -> C and C++ = GCCARM

        • Compilers -> Manual -> C -> GCCARM = /opt/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc

        • Compilers -> Manual -> C++ -> GCCARM = /opt/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++

        My own Kit has two Warnings:

        • Device not set
        • Debugger not set

        I think it doesn't metter

        Error:
        :-1: error: /home/user/Desktop/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++: Command not found
        (it is deprecated path)

        And environment variables:
        $ printenv | grep QT
        QT_ACCESSIBILITY=1
        QT_AUTO_SCREEN_SCALE_FACTOR=0

        I have not ideas whats wrong :(


        Ok, how I can specify compiler if I should compile project by command (without QtCoreator)?
        For example:

        cd OwnProject
        /opt/Qt5.9/bin/qmake OwnProject.pro -spec "devices/linux-imx6-g++" CONFIG+=release CONFIG+=qtquickcompiler
        

        I tried this:

        $ export CC=/opt/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
        $ export CXX=/opt/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++
        $ /opt/Qt5.9/bin/qmake MCP1App.pro -spec "devices/linux-imx6-g++" CONFIG+=release CONFIG+=qtquickcompiler
        Project ERROR: Cannot run target compiler '/home/user/Desktop/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++'. Output:
        ===================
        sh: 1:/home/user/Desktop/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++: not found
        ===================
        Maybe you forgot to setup the environment?
        
        K Pablo J. RoginaP 2 Replies Last reply
        0
        • R r3d9u11

          @koahnig Hello. Thank for the reply.

          Yes, I've checked and all settings are right:

          • Kits -> Manual -> Compiler -> C and C++ = GCCARM

          • Compilers -> Manual -> C -> GCCARM = /opt/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc

          • Compilers -> Manual -> C++ -> GCCARM = /opt/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++

          My own Kit has two Warnings:

          • Device not set
          • Debugger not set

          I think it doesn't metter

          Error:
          :-1: error: /home/user/Desktop/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++: Command not found
          (it is deprecated path)

          And environment variables:
          $ printenv | grep QT
          QT_ACCESSIBILITY=1
          QT_AUTO_SCREEN_SCALE_FACTOR=0

          I have not ideas whats wrong :(


          Ok, how I can specify compiler if I should compile project by command (without QtCoreator)?
          For example:

          cd OwnProject
          /opt/Qt5.9/bin/qmake OwnProject.pro -spec "devices/linux-imx6-g++" CONFIG+=release CONFIG+=qtquickcompiler
          

          I tried this:

          $ export CC=/opt/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
          $ export CXX=/opt/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++
          $ /opt/Qt5.9/bin/qmake MCP1App.pro -spec "devices/linux-imx6-g++" CONFIG+=release CONFIG+=qtquickcompiler
          Project ERROR: Cannot run target compiler '/home/user/Desktop/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++'. Output:
          ===================
          sh: 1:/home/user/Desktop/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++: not found
          ===================
          Maybe you forgot to setup the environment?
          
          K Offline
          K Offline
          koahnig
          wrote on last edited by
          #4

          @r3d9u11 said in How to set compile for qmake:

          @koahnig Hello. Thank for the reply.

          Yes, I've checked and all settings are right:

          • Kits -> Manual -> Compiler -> C and C++ = GCCARM

          • Compilers -> Manual -> C -> GCCARM = /opt/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc

          • Compilers -> Manual -> C++ -> GCCARM = /opt/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++

          Did you self-compile Qt libs with the toolchain?

          @r3d9u11 said in How to set compile for qmake:

          Error:
          :-1: error: /home/user/Desktop/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++:

          That seem to be the relevant error. Note the difference in path to the compiler.
          AFAIK if you have self-compiled Qt libs and moved or reinstalled the compiler in another location, this might cause such problems.

          When building Qt libs a specific version of qmake for your machine is generated. This holds the path to the toolchain used for compilation. I do not know how tô fix that afterwards. Possibly that is done in mkspecs with its different compiler settings.
          Anyway I tend to have clean setups with lowest amount of intereference in special adaptations.

          If I am correct with self-compilation and moving or reinstallation of cross-compiler, you have 2 options:

          1. Recompile Qt libs with new location of cross-compiler
          2. Move back the cross-compiler to the user/Desktop location where qmake generated process is looking for it.

          Vote the answer(s) that helped you to solve your issue(s)

          R 1 Reply Last reply
          2
          • R r3d9u11

            @koahnig Hello. Thank for the reply.

            Yes, I've checked and all settings are right:

            • Kits -> Manual -> Compiler -> C and C++ = GCCARM

            • Compilers -> Manual -> C -> GCCARM = /opt/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc

            • Compilers -> Manual -> C++ -> GCCARM = /opt/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++

            My own Kit has two Warnings:

            • Device not set
            • Debugger not set

            I think it doesn't metter

            Error:
            :-1: error: /home/user/Desktop/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++: Command not found
            (it is deprecated path)

            And environment variables:
            $ printenv | grep QT
            QT_ACCESSIBILITY=1
            QT_AUTO_SCREEN_SCALE_FACTOR=0

            I have not ideas whats wrong :(


            Ok, how I can specify compiler if I should compile project by command (without QtCoreator)?
            For example:

            cd OwnProject
            /opt/Qt5.9/bin/qmake OwnProject.pro -spec "devices/linux-imx6-g++" CONFIG+=release CONFIG+=qtquickcompiler
            

            I tried this:

            $ export CC=/opt/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
            $ export CXX=/opt/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++
            $ /opt/Qt5.9/bin/qmake MCP1App.pro -spec "devices/linux-imx6-g++" CONFIG+=release CONFIG+=qtquickcompiler
            Project ERROR: Cannot run target compiler '/home/user/Desktop/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++'. Output:
            ===================
            sh: 1:/home/user/Desktop/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++: not found
            ===================
            Maybe you forgot to setup the environment?
            
            Pablo J. RoginaP Offline
            Pablo J. RoginaP Offline
            Pablo J. Rogina
            wrote on last edited by
            #5

            @r3d9u11 said in How to set compile for qmake:

            Device not set
            Debugger not set

            I think it doesn't metter

            Yes, it DOES matter... as it seems you're trying to cross-compile a Qt app. So your kit needs a device which you need to create under tab Devices

            /home/user/Desktop/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++: not found

            Please check that your cross-compiler is installed properly and available in the path

            In addition, did you cross-compile Qt framework already?
            Or are you using a pre-built SDK to cross-compile Qt apps?

            Upvote the answer(s) that helped you solve the issue
            Use "Topic Tools" button to mark your post as Solved
            Add screenshots via postimage.org
            Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

            R 3 Replies Last reply
            2
            • K koahnig

              @r3d9u11 said in How to set compile for qmake:

              @koahnig Hello. Thank for the reply.

              Yes, I've checked and all settings are right:

              • Kits -> Manual -> Compiler -> C and C++ = GCCARM

              • Compilers -> Manual -> C -> GCCARM = /opt/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc

              • Compilers -> Manual -> C++ -> GCCARM = /opt/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++

              Did you self-compile Qt libs with the toolchain?

              @r3d9u11 said in How to set compile for qmake:

              Error:
              :-1: error: /home/user/Desktop/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++:

              That seem to be the relevant error. Note the difference in path to the compiler.
              AFAIK if you have self-compiled Qt libs and moved or reinstalled the compiler in another location, this might cause such problems.

              When building Qt libs a specific version of qmake for your machine is generated. This holds the path to the toolchain used for compilation. I do not know how tô fix that afterwards. Possibly that is done in mkspecs with its different compiler settings.
              Anyway I tend to have clean setups with lowest amount of intereference in special adaptations.

              If I am correct with self-compilation and moving or reinstallation of cross-compiler, you have 2 options:

              1. Recompile Qt libs with new location of cross-compiler
              2. Move back the cross-compiler to the user/Desktop location where qmake generated process is looking for it.
              R Offline
              R Offline
              r3d9u11
              wrote on last edited by r3d9u11
              #6

              @koahnig said in How to set compile for qmake:

              That seem to be the relevant error. Note the difference in path to the compiler.
              AFAIK if you have self-compiled Qt libs and moved or reinstalled the compiler in another location, this might cause such problems.

              Yes, I I'm looking for way to set toolchain.
              As I told, I've set bin/qt.conf with Prefix, and it works fine (I see correct paths).

              But what's wrong with TC?
              We can't force specify path to compiler?

              When building Qt libs a specific version of qmake for your machine is generated. This holds the path to the toolchain used for compilation. I do not know how tô fix that afterwards. Possibly that is done in mkspecs with its different compiler settings.

              I've tried to change and export variable CROSS_COMPILER, but without success :(

              1 Reply Last reply
              0
              • Pablo J. RoginaP Pablo J. Rogina

                @r3d9u11 said in How to set compile for qmake:

                Device not set
                Debugger not set

                I think it doesn't metter

                Yes, it DOES matter... as it seems you're trying to cross-compile a Qt app. So your kit needs a device which you need to create under tab Devices

                /home/user/Desktop/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++: not found

                Please check that your cross-compiler is installed properly and available in the path

                In addition, did you cross-compile Qt framework already?
                Or are you using a pre-built SDK to cross-compile Qt apps?

                R Offline
                R Offline
                r3d9u11
                wrote on last edited by r3d9u11
                #7

                @Pablo-J-Rogina said in How to set compile for qmake:

                Yes, it DOES matter... as it seems you're trying to cross-compile a Qt app. So your kit needs a device which you need to create under tab Devices

                Sure, I'm trying to cross-compile application.
                But I dont want install and deploy it.
                All paths to Qt libs are right. However, I still can't make application even I've set valid path to compiler and Qt libs?

                1 Reply Last reply
                0
                • Pablo J. RoginaP Pablo J. Rogina

                  @r3d9u11 said in How to set compile for qmake:

                  Device not set
                  Debugger not set

                  I think it doesn't metter

                  Yes, it DOES matter... as it seems you're trying to cross-compile a Qt app. So your kit needs a device which you need to create under tab Devices

                  /home/user/Desktop/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++: not found

                  Please check that your cross-compiler is installed properly and available in the path

                  In addition, did you cross-compile Qt framework already?
                  Or are you using a pre-built SDK to cross-compile Qt apps?

                  R Offline
                  R Offline
                  r3d9u11
                  wrote on last edited by r3d9u11
                  #8

                  @Pablo-J-Rogina said in How to set compile for qmake:

                  Yes, it DOES matter... as it seems you're trying to cross-compile a Qt app. So your kit needs a device which you need to create under tab Devices

                  Ok, but if I don't move TC, it works. Event section Device isn't configured and still empty.
                  I think that this section deep for remove debugging and/or deployment, but not for compilation, no?

                  1 Reply Last reply
                  0
                  • Pablo J. RoginaP Pablo J. Rogina

                    @r3d9u11 said in How to set compile for qmake:

                    Device not set
                    Debugger not set

                    I think it doesn't metter

                    Yes, it DOES matter... as it seems you're trying to cross-compile a Qt app. So your kit needs a device which you need to create under tab Devices

                    /home/user/Desktop/gcc-linaro-7.5.0-2019.12-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++: not found

                    Please check that your cross-compiler is installed properly and available in the path

                    In addition, did you cross-compile Qt framework already?
                    Or are you using a pre-built SDK to cross-compile Qt apps?

                    R Offline
                    R Offline
                    r3d9u11
                    wrote on last edited by r3d9u11
                    #9

                    @Pablo-J-Rogina
                    shortly: If I understand right, once Qt cross-compiled, will store original TC path into qmake and can't be changed (to compile any Qt project with different TC path, for example) ?

                    Pablo J. RoginaP 1 Reply Last reply
                    0
                    • R r3d9u11

                      @Pablo-J-Rogina
                      shortly: If I understand right, once Qt cross-compiled, will store original TC path into qmake and can't be changed (to compile any Qt project with different TC path, for example) ?

                      Pablo J. RoginaP Offline
                      Pablo J. RoginaP Offline
                      Pablo J. Rogina
                      wrote on last edited by Pablo J. Rogina
                      #10

                      @r3d9u11 said in How to set compile for qmake:

                      once Qt cross-compiled, will store original TC path into qmake

                      That's what I understand too. Hopefully that changed since Qt 5.14 with the "relocatable Qt" feature. See this blog post for a detailed explanation, or original post about the feature.

                      Upvote the answer(s) that helped you solve the issue
                      Use "Topic Tools" button to mark your post as Solved
                      Add screenshots via postimage.org
                      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                      R 1 Reply Last reply
                      2
                      • Pablo J. RoginaP Pablo J. Rogina

                        @r3d9u11 said in How to set compile for qmake:

                        once Qt cross-compiled, will store original TC path into qmake

                        That's what I understand too. Hopefully that changed since Qt 5.14 with the "relocatable Qt" feature. See this blog post for a detailed explanation, or original post about the feature.

                        R Offline
                        R Offline
                        r3d9u11
                        wrote on last edited by r3d9u11
                        #11

                        @Pablo-J-Rogina thank you for hints and useful links
                        (also I should to do 'make clean' before calling qmake)

                        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