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. Qt Creator says "Project ERROR: Cannot run compiler 'cl'. Output:"
Forum Updated to NodeBB v4.3 + New Features

Qt Creator says "Project ERROR: Cannot run compiler 'cl'. Output:"

Scheduled Pinned Locked Moved Solved Installation and Deployment
17 Posts 4 Posters 17.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.
  • M Offline
    M Offline
    mvelanka
    wrote on 11 Dec 2018, 18:17 last edited by
    #1

    I am new to Qt and this is my first post.

    I am using Qt 5.12 on two different computers ... both on MSVC (MSVisual Stuido 2017 ) identical version on both the machines but at different locations

    computer 1. standard location c:\program files .... etc
    Qt 5.12 is installed on e drive ..........that is a usb drive

    computer 2. it is D:\ ..... etc
    Qt is also installed on D:\Qt directory

    On computer 1, I have absolutely no problem.
    QtCreator started in next minute and I could compile and run textedit project in 10 minutes.

    On computer 2, I cannot use Qt creator at all
    It did not set the kit itself like it did on computer 1
    It told me to set up kits ......so I put the paths for cl.exe and cmake.exe (after reading on google and Qt forums)

    Still when I try to compile, it throws following error:

    This is what I read from General Messages tab :

    Running Windows Runtime device detection.
    No winrtrunner.exe found.
    Project ERROR: Cannot run compiler 'cl'. Output:

    ===================
    Maybe you forgot to setup the environment?
    Error while parsing file D:\Qt\Examples\Qt-5.12.0\widgets\richtext\textedit\textedit.pro. Giving up.
    Project ERROR: Cannot run compiler 'cl'. Output:

    ===================
    Maybe you forgot to setup the environment?
    Error while parsing file D:\Qt\Examples\Qt-5.12.0\widgets\richtext\textedit\textedit.pro. Giving up.

    Please help or point me to where I can get proper direction.
    Thanks

    J 1 Reply Last reply 12 Dec 2018, 06:19
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 11 Dec 2018, 20:10 last edited by
      #2

      Hi and welcome to devnet,

      Did you install Visual Studio 2017 also on both machines ?

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

      M 1 Reply Last reply 11 Dec 2018, 20:26
      1
      • S SGaist
        11 Dec 2018, 20:10

        Hi and welcome to devnet,

        Did you install Visual Studio 2017 also on both machines ?

        M Offline
        M Offline
        mvelanka
        wrote on 11 Dec 2018, 20:26 last edited by
        #3

        @SGaist Yes sir. I have installed Visual Studio 2017 on both these machines and am successfully able to use both of those to build and create other Windows executables and libraries.

        Thanks

        A 1 Reply Last reply 11 Dec 2018, 20:33
        0
        • M mvelanka
          11 Dec 2018, 20:26

          @SGaist Yes sir. I have installed Visual Studio 2017 on both these machines and am successfully able to use both of those to build and create other Windows executables and libraries.

          Thanks

          A Offline
          A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on 11 Dec 2018, 20:33 last edited by
          #4

          @mvelanka

          Running Windows Runtime device detection.
          No winrtrunner.exe found

          Do you want to create classic Windows programs or UWP apps? Looks like the Qt version here is for UWP, not sure that was your intention.

          Regards

          Qt has to stay free or it will die.

          M 1 Reply Last reply 11 Dec 2018, 20:58
          1
          • A aha_1980
            11 Dec 2018, 20:33

            @mvelanka

            Running Windows Runtime device detection.
            No winrtrunner.exe found

            Do you want to create classic Windows programs or UWP apps? Looks like the Qt version here is for UWP, not sure that was your intention.

            Regards

            M Offline
            M Offline
            mvelanka
            wrote on 11 Dec 2018, 20:58 last edited by
            #5

            @aha_1980 I want to create Windows Programs with widgets like rich text editor. ........I did exactly same install for Qt on both these machines (only difference is the locations of VS 2017 and Qt)

            A 1 Reply Last reply 12 Dec 2018, 06:14
            0
            • M mvelanka
              11 Dec 2018, 20:58

              @aha_1980 I want to create Windows Programs with widgets like rich text editor. ........I did exactly same install for Qt on both these machines (only difference is the locations of VS 2017 and Qt)

              A Offline
              A Offline
              aha_1980
              Lifetime Qt Champion
              wrote on 12 Dec 2018, 06:14 last edited by
              #6

              @mvelanka can you show the installed Qt versions in Options > Kits?

              Qt has to stay free or it will die.

              M 1 Reply Last reply 12 Dec 2018, 15:40
              0
              • M mvelanka
                11 Dec 2018, 18:17

                I am new to Qt and this is my first post.

                I am using Qt 5.12 on two different computers ... both on MSVC (MSVisual Stuido 2017 ) identical version on both the machines but at different locations

                computer 1. standard location c:\program files .... etc
                Qt 5.12 is installed on e drive ..........that is a usb drive

                computer 2. it is D:\ ..... etc
                Qt is also installed on D:\Qt directory

                On computer 1, I have absolutely no problem.
                QtCreator started in next minute and I could compile and run textedit project in 10 minutes.

                On computer 2, I cannot use Qt creator at all
                It did not set the kit itself like it did on computer 1
                It told me to set up kits ......so I put the paths for cl.exe and cmake.exe (after reading on google and Qt forums)

                Still when I try to compile, it throws following error:

                This is what I read from General Messages tab :

                Running Windows Runtime device detection.
                No winrtrunner.exe found.
                Project ERROR: Cannot run compiler 'cl'. Output:

                ===================
                Maybe you forgot to setup the environment?
                Error while parsing file D:\Qt\Examples\Qt-5.12.0\widgets\richtext\textedit\textedit.pro. Giving up.
                Project ERROR: Cannot run compiler 'cl'. Output:

                ===================
                Maybe you forgot to setup the environment?
                Error while parsing file D:\Qt\Examples\Qt-5.12.0\widgets\richtext\textedit\textedit.pro. Giving up.

                Please help or point me to where I can get proper direction.
                Thanks

                J Offline
                J Offline
                J.Hilk
                Moderators
                wrote on 12 Dec 2018, 06:19 last edited by
                #7

                @mvelanka said in Qt Creator says "Project ERROR: Cannot run compiler 'cl'. Output:":

                No winrtrunner.exe found

                seems like you did not install the windows software development kit ? It's needed for the debugger.
                AFAIC that one comes seperately from Visual Studio


                Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                Q: What's that?
                A: It's blue light.
                Q: What does it do?
                A: It turns blue.

                M 1 Reply Last reply 12 Dec 2018, 15:54
                0
                • A aha_1980
                  12 Dec 2018, 06:14

                  @mvelanka can you show the installed Qt versions in Options > Kits?

                  M Offline
                  M Offline
                  mvelanka
                  wrote on 12 Dec 2018, 15:40 last edited by
                  #8

                  @aha_1980,
                  Qt Versions are shown as follows:
                  0_1544629164272_QtVersionsInKits.png

                  HTH
                  Thanks

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 12 Dec 2018, 15:41 last edited by
                    #9

                    You should also compare the Compilers tab and the Kits tab.

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

                    M 1 Reply Last reply 12 Dec 2018, 16:06
                    0
                    • J J.Hilk
                      12 Dec 2018, 06:19

                      @mvelanka said in Qt Creator says "Project ERROR: Cannot run compiler 'cl'. Output:":

                      No winrtrunner.exe found

                      seems like you did not install the windows software development kit ? It's needed for the debugger.
                      AFAIC that one comes seperately from Visual Studio

                      M Offline
                      M Offline
                      mvelanka
                      wrote on 12 Dec 2018, 15:54 last edited by
                      #10

                      @J.Hilk

                      I believe I have two kits installed see this

                      0_1544630035065_WindowsSDKs.png

                      Hope, I am in the right direction.
                      Thanks

                      1 Reply Last reply
                      0
                      • S SGaist
                        12 Dec 2018, 15:41

                        You should also compare the Compilers tab and the Kits tab.

                        M Offline
                        M Offline
                        mvelanka
                        wrote on 12 Dec 2018, 16:06 last edited by
                        #11

                        @SGaist ,

                        Here is the screen shot showing compilers
                        0_1544630168559_CompilersInKits.png

                        In that "Custom" is the one I created/added by entering the values for Compiler Path and Make Path

                        HTH
                        Thanks

                        A 1 Reply Last reply 12 Dec 2018, 17:32
                        0
                        • M mvelanka
                          12 Dec 2018, 16:06

                          @SGaist ,

                          Here is the screen shot showing compilers
                          0_1544630168559_CompilersInKits.png

                          In that "Custom" is the one I created/added by entering the values for Compiler Path and Make Path

                          HTH
                          Thanks

                          A Offline
                          A Offline
                          aha_1980
                          Lifetime Qt Champion
                          wrote on 12 Dec 2018, 17:32 last edited by
                          #12

                          @mvelanka

                          it doesn't work like this. MSVC compilers must be autodetected to be useable. Do you have the vcvars*.bat in the VS folder?

                          Qt has to stay free or it will die.

                          M 1 Reply Last reply 12 Dec 2018, 18:33
                          0
                          • A aha_1980
                            12 Dec 2018, 17:32

                            @mvelanka

                            it doesn't work like this. MSVC compilers must be autodetected to be useable. Do you have the vcvars*.bat in the VS folder?

                            M Offline
                            M Offline
                            mvelanka
                            wrote on 12 Dec 2018, 18:33 last edited by
                            #13

                            @aha_1980 ,
                            Yes I do have them
                            0_1544639574536_vcvars.png

                            How to use these batch files?
                            Please let me know
                            Thanks

                            A 1 Reply Last reply 12 Dec 2018, 18:47
                            0
                            • M mvelanka
                              12 Dec 2018, 18:33

                              @aha_1980 ,
                              Yes I do have them
                              0_1544639574536_vcvars.png

                              How to use these batch files?
                              Please let me know
                              Thanks

                              A Offline
                              A Offline
                              aha_1980
                              Lifetime Qt Champion
                              wrote on 12 Dec 2018, 18:47 last edited by
                              #14

                              @mvelanka QtCreator uns this batch file to setup the build environment. I'm not sure how it finds this file, but it seems your non-standard installation confuses it.

                              Any reason to not install MSVC on drive C? ( I guess Qt is fine on D, but for the compiler I'm unsure)

                              Qt has to stay free or it will die.

                              M 1 Reply Last reply 12 Dec 2018, 18:55
                              0
                              • A aha_1980
                                12 Dec 2018, 18:47

                                @mvelanka QtCreator uns this batch file to setup the build environment. I'm not sure how it finds this file, but it seems your non-standard installation confuses it.

                                Any reason to not install MSVC on drive C? ( I guess Qt is fine on D, but for the compiler I'm unsure)

                                M Offline
                                M Offline
                                mvelanka
                                wrote on 12 Dec 2018, 18:55 last edited by
                                #15

                                @aha_1980 ,

                                The reason why VS and kits is in non standard location is because it is used in that way for our other projects.
                                We have many projects on windows.
                                This is the first time I am trying Qt

                                M 1 Reply Last reply 12 Dec 2018, 19:41
                                0
                                • M mvelanka
                                  12 Dec 2018, 18:55

                                  @aha_1980 ,

                                  The reason why VS and kits is in non standard location is because it is used in that way for our other projects.
                                  We have many projects on windows.
                                  This is the first time I am trying Qt

                                  M Offline
                                  M Offline
                                  mvelanka
                                  wrote on 12 Dec 2018, 19:41 last edited by
                                  #16

                                  @mvelanka ,
                                  Hopefully I have found the issue and the fix.

                                  Apparently, there is nothing wrong with Qt.
                                  I looked in the source code for QtCreator on this page:
                                  https://code.woboq.org/qt5/qt-creator/src/plugins/projectexplorer/msvctoolchain.cpp.html
                                  (That may not be latest, however it gave me idea how QtCreator looks for the vcvars bat files.)
                                  It looks in the registry.
                                  For some strange reason, the path for VC was stored as
                                  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community
                                  instead of
                                  D:\Program Files (x86)\Microsoft Visual Studio\2017\Community
                                  I do not know why!!

                                  So I manually fixed it in the registry to
                                  D:\Program Files (x86)\Microsoft Visual Studio\2017\Community
                                  and restarted QtCreator, went to kits.........it gave me all the possible combinations to choose VC compiler
                                  I chose amd64_x86...........and everything is working okay
                                  I have test built one example project (textedit) and it seems to be running well.

                                  I will still keep watch on both Qt and our other projects is this registry setup change creates any other issues.

                                  Thanks for your support and clues.

                                  A 1 Reply Last reply 12 Dec 2018, 19:52
                                  4
                                  • M mvelanka
                                    12 Dec 2018, 19:41

                                    @mvelanka ,
                                    Hopefully I have found the issue and the fix.

                                    Apparently, there is nothing wrong with Qt.
                                    I looked in the source code for QtCreator on this page:
                                    https://code.woboq.org/qt5/qt-creator/src/plugins/projectexplorer/msvctoolchain.cpp.html
                                    (That may not be latest, however it gave me idea how QtCreator looks for the vcvars bat files.)
                                    It looks in the registry.
                                    For some strange reason, the path for VC was stored as
                                    C:\Program Files (x86)\Microsoft Visual Studio\2017\Community
                                    instead of
                                    D:\Program Files (x86)\Microsoft Visual Studio\2017\Community
                                    I do not know why!!

                                    So I manually fixed it in the registry to
                                    D:\Program Files (x86)\Microsoft Visual Studio\2017\Community
                                    and restarted QtCreator, went to kits.........it gave me all the possible combinations to choose VC compiler
                                    I chose amd64_x86...........and everything is working okay
                                    I have test built one example project (textedit) and it seems to be running well.

                                    I will still keep watch on both Qt and our other projects is this registry setup change creates any other issues.

                                    Thanks for your support and clues.

                                    A Offline
                                    A Offline
                                    aha_1980
                                    Lifetime Qt Champion
                                    wrote on 12 Dec 2018, 19:52 last edited by
                                    #17

                                    @mvelanka wow - good observation! glad you got it running. So please mark this topic as SOLVED now. Thanks!

                                    Qt has to stay free or it will die.

                                    1 Reply Last reply
                                    0

                                    1/17

                                    11 Dec 2018, 18:17

                                    • Login

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