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. LNK1158: cannot run 'rc.exe'
QtWS25 Last Chance

LNK1158: cannot run 'rc.exe'

Scheduled Pinned Locked Moved Solved Installation and Deployment
16 Posts 9 Posters 52.6k 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.
  • Z Offline
    Z Offline
    zzzhhhzzzhhh
    wrote on 18 May 2018, 11:13 last edited by
    #1

    This error occurs after I installed Visual Studio 2017 and changed graphics card and its driver. Now whenever I clicked the "build" icon (the hammer) in Qt Creator, I will receive an error message "NK1158: cannot run 'rc.exe'". It looks like that this message is from Visual Studio so I reinstalled VS2015, VS2017, Windows SDK and Qt, but the same problem persists. How to solve this problem, then?

    Some info about my computer:

    • Windows 10 1803
    • VS2015 Update 3 version 14.0.25431.01
    • Visual Studio 2017 version 15.7.1
    • Qt 5.10.1

    If you need any other info, please let me know. Thank you for help.

    J 1 Reply Last reply 18 May 2018, 11:22
    1
    • Z zzzhhhzzzhhh
      18 May 2018, 11:13

      This error occurs after I installed Visual Studio 2017 and changed graphics card and its driver. Now whenever I clicked the "build" icon (the hammer) in Qt Creator, I will receive an error message "NK1158: cannot run 'rc.exe'". It looks like that this message is from Visual Studio so I reinstalled VS2015, VS2017, Windows SDK and Qt, but the same problem persists. How to solve this problem, then?

      Some info about my computer:

      • Windows 10 1803
      • VS2015 Update 3 version 14.0.25431.01
      • Visual Studio 2017 version 15.7.1
      • Qt 5.10.1

      If you need any other info, please let me know. Thank you for help.

      J Offline
      J Offline
      J.Hilk
      Moderators
      wrote on 18 May 2018, 11:22 last edited by
      #2

      hi, @zzzhhhzzzhhh

      pleasemake sure, that the WindowsKit bin folder is part of your Build Environment

      0_1526642474311_2650c212-8bf8-4133-8c63-8e24436325f6-image.png

      i had this issue a couple of month back, that the windows kit was no longer automatically found and I had to add it manually


      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.

      1 Reply Last reply
      8
      • Z Offline
        Z Offline
        zzzhhhzzzhhh
        wrote on 18 May 2018, 11:38 last edited by
        #3

        Yes, that's the problem. I added "C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x64" into the path variable and now Qt builds correctly. Thank you very much for your help!

        P 1 Reply Last reply 18 May 2018, 12:37
        3
        • Z zzzhhhzzzhhh
          18 May 2018, 11:38

          Yes, that's the problem. I added "C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x64" into the path variable and now Qt builds correctly. Thank you very much for your help!

          P Offline
          P Offline
          Pablo J. Rogina
          wrote on 18 May 2018, 12:37 last edited by
          #4

          @zzzhhhzzzhhh if your issue is solved, please don't forget to mark your post as such. Thanks.

          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

          1 Reply Last reply
          0
          • R Offline
            R Offline
            rmam
            wrote on 21 Jun 2018, 15:49 last edited by
            #5

            @J-Hilk thank you for finding the fix. I was experiencing the same problem after installing Qt Creator 4.6.2 in Windows and somehow msvc2017 worked fine although msvc2015 failed to find rc.exe.

            Having said that, is there a way to automatically configure the compiler to include the right path? Your fix does the trick, but I'm assuming that it requires to tweak each project each time that we intend to do a build with msvc2015.

            J 1 Reply Last reply 22 Jun 2018, 04:40
            0
            • R rmam
              21 Jun 2018, 15:49

              @J-Hilk thank you for finding the fix. I was experiencing the same problem after installing Qt Creator 4.6.2 in Windows and somehow msvc2017 worked fine although msvc2015 failed to find rc.exe.

              Having said that, is there a way to automatically configure the compiler to include the right path? Your fix does the trick, but I'm assuming that it requires to tweak each project each time that we intend to do a build with msvc2015.

              J Offline
              J Offline
              J.Hilk
              Moderators
              wrote on 22 Jun 2018, 04:40 last edited by
              #6

              hi @rmam ,
              you're welcome :)

              Have a look at this topic
              QtCreator Build Environment Config File

              In there @aha_1980 had the correct idea/knowledge in how to modify your kits to automatically add folders to your build environment.

              But, you'll still have to do it once for each installed Kit.

              Greetings.


              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.

              1 Reply Last reply
              3
              • D Offline
                D Offline
                D8vLoper
                wrote on 16 Jul 2019, 12:50 last edited by
                #7

                I know this is old but the real reason for the missing rc.exe is a bug in Microsoft SDKs path installation.
                Here is a "cleaner" fix : https://stackoverflow.com/questions/43847542/rc-exe-no-longer-found-in-vs-2015-command-prompt

                1 Reply Last reply
                5
                • K Offline
                  K Offline
                  kamalberahal
                  wrote on 8 Aug 2019, 11:25 last edited by
                  #8

                  Hello everyone,

                  I have the same issue, but I can't find the Build Environment settings in Qt5, can you show me where to find it?
                  Thanks in advance

                  jsulmJ 1 Reply Last reply 8 Aug 2019, 12:06
                  0
                  • K kamalberahal
                    8 Aug 2019, 11:25

                    Hello everyone,

                    I have the same issue, but I can't find the Build Environment settings in Qt5, can you show me where to find it?
                    Thanks in advance

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on 8 Aug 2019, 12:06 last edited by
                    #9

                    @kamalberahal You mean in QtCreator not Qt5 I guess?
                    On the left side click on "Projects", select the Kit you're using and go to Build.

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    3
                    • K Offline
                      K Offline
                      kamalberahal
                      wrote on 8 Aug 2019, 12:11 last edited by
                      #10

                      Yes sorry that's what I meant. Thanks a lot, I have found ir

                      R 1 Reply Last reply 2 Feb 2020, 22:33
                      2
                      • S Offline
                        S Offline
                        stoplight
                        wrote on 9 Sept 2019, 13:06 last edited by
                        #11

                        Ya, for me it was already in my path. My problem was that I had VS2017 installed, but the qt is by default meant to build for the 2015 version. So just change the build options to the VS2017x64 version.

                        jsulmJ 1 Reply Last reply 10 Sept 2019, 07:11
                        0
                        • S stoplight
                          9 Sept 2019, 13:06

                          Ya, for me it was already in my path. My problem was that I had VS2017 installed, but the qt is by default meant to build for the 2015 version. So just change the build options to the VS2017x64 version.

                          jsulmJ Offline
                          jsulmJ Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on 10 Sept 2019, 07:11 last edited by
                          #12

                          @stoplight said in LNK1158: cannot run 'rc.exe':

                          but the qt is by default meant to build for the 2015 version

                          Newer Qt versions are available for VS2017 as well.

                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          1
                          • K kamalberahal
                            8 Aug 2019, 12:11

                            Yes sorry that's what I meant. Thanks a lot, I have found ir

                            R Offline
                            R Offline
                            Ripegas
                            wrote on 2 Feb 2020, 22:33 last edited by
                            #13
                            This post is deleted!
                            1 Reply Last reply
                            0
                            • R Offline
                              R Offline
                              Ripegas
                              wrote on 2 Feb 2020, 22:43 last edited by Ripegas 2 Feb 2020, 22:43
                              #14

                              I cannot find Build Environment settings , can you send me photo please, where I can find it
                              Thank you

                              jsulmJ 1 Reply Last reply 3 Feb 2020, 05:33
                              0
                              • R Ripegas
                                2 Feb 2020, 22:43

                                I cannot find Build Environment settings , can you send me photo please, where I can find it
                                Thank you

                                jsulmJ Offline
                                jsulmJ Offline
                                jsulm
                                Lifetime Qt Champion
                                wrote on 3 Feb 2020, 05:33 last edited by
                                #15

                                @Ripegas Open your project in QtCreator. On the left side click on "Projects", then under Build & Run" select the Kit you're using and then "Build". Now, at the bottom you will see "Build Environment"...

                                https://forum.qt.io/topic/113070/qt-code-of-conduct

                                R 1 Reply Last reply 3 Feb 2020, 11:02
                                2
                                • jsulmJ jsulm
                                  3 Feb 2020, 05:33

                                  @Ripegas Open your project in QtCreator. On the left side click on "Projects", then under Build & Run" select the Kit you're using and then "Build". Now, at the bottom you will see "Build Environment"...

                                  R Offline
                                  R Offline
                                  Ripegas
                                  wrote on 3 Feb 2020, 11:02 last edited by
                                  #16

                                  @jsulm Thank you, I have found it

                                  1 Reply Last reply
                                  1

                                  • Login

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