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 cannot find rc.exe Codes: fatal error RC1106: invalid option: -ologo, LNK1327 / LNK1158 : fatal error during running rc.exe

Qt cannot find rc.exe Codes: fatal error RC1106: invalid option: -ologo, LNK1327 / LNK1158 : fatal error during running rc.exe

Scheduled Pinned Locked Moved Solved Installation and Deployment
21 Posts 5 Posters 11.0k 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.
  • J.HilkJ Online
    J.HilkJ Online
    J.Hilk
    Moderators
    wrote on last edited by
    #8

    I believe we had this recently,

    https://forum.qt.io/topic/90839/lnk1158-cannot-run-rc-exe

    the topic is marked unsolved, but the posted solution does work.


    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
    2
    • kkoehneK kkoehne

      rcc.exe is nowadays part of the Windows Kit, while cl.exe is part of Visual Studio. For me (latest Visual Studio 2017 amd64), this is e.g.

      D:>where rc.exe
      C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x64\rc.exe
      
      D:>where cl.exe
      C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.14.26428\bin\Hostx64\x64\cl.exe
      

      Try to launch the Visual Studio Command Prompt; it should put the right directories in your PATH. Is rc.exe and cl.exe available in there?

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

      @kkoehne I am a complete beginner. Please walk me through this
      -Where is "Visual Studio Command Prompt"
      -Where to edit Qt's PATH

      1 Reply Last reply
      0
      • kkoehneK Offline
        kkoehneK Offline
        kkoehne
        Moderators
        wrote on last edited by
        #10

        For how to find the Visual Studio Command Prompt, see https://msdn.microsoft.com/en-us/library/f35ctcxw.aspx .

        After opening the prompt, run

        where rc.exe
        rc.exe -v
        where cl.exe
        cl.exe -v

        If you can run these commands successfully, it at least means your Visual Studio installation is complete.

        Director R&D, The Qt Company

        A 1 Reply Last reply
        2
        • kkoehneK kkoehne

          For how to find the Visual Studio Command Prompt, see https://msdn.microsoft.com/en-us/library/f35ctcxw.aspx .

          After opening the prompt, run

          where rc.exe
          rc.exe -v
          where cl.exe
          cl.exe -v

          If you can run these commands successfully, it at least means your Visual Studio installation is complete.

          A Offline
          A Offline
          Anyone700
          wrote on last edited by
          #11

          @kkoehne I think you misunderstand. I need to add: "C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x64" to the Qt Build Environment. I do not know how to get to this window to do that: https://ddgobkiprc33d.cloudfront.net/3f7cdac6-e900-47e8-be4e-a9a1338d0d4c.png

          aha_1980A 1 Reply Last reply
          0
          • A Anyone700

            @kkoehne I think you misunderstand. I need to add: "C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x64" to the Qt Build Environment. I do not know how to get to this window to do that: https://ddgobkiprc33d.cloudfront.net/3f7cdac6-e900-47e8-be4e-a9a1338d0d4c.png

            aha_1980A Offline
            aha_1980A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on last edited by
            #12

            @Anyone700

            Tools > Options > Build&Run > Kits > «Your MSVC Kit» > Build Environment

            Qt has to stay free or it will die.

            1 Reply Last reply
            1
            • A Offline
              A Offline
              Anyone700
              wrote on last edited by Anyone700
              #13

              @aha_1980 I already looked there and this is what I see.
              0_1530559095630_Capture.PNG
              It bothers me that Qt does not function on install for some of it's users and when reported. Was closed as "Not a bug".

              aha_1980A 1 Reply Last reply
              0
              • A Anyone700

                @aha_1980 I already looked there and this is what I see.
                0_1530559095630_Capture.PNG
                It bothers me that Qt does not function on install for some of it's users and when reported. Was closed as "Not a bug".

                aha_1980A Offline
                aha_1980A Offline
                aha_1980
                Lifetime Qt Champion
                wrote on last edited by aha_1980
                #14

                @Anyone700 because it is no Qt bug. As MS compilers need to be set up separately, they, well need to be set up correctly.

                So why don't you use the 'Change' button next to Environment to add the path to rcc.exe?

                Qt has to stay free or it will die.

                A 1 Reply Last reply
                2
                • aha_1980A aha_1980

                  @Anyone700 because it is no Qt bug. As MS compilers need to be set up separately, they, well need to be set up correctly.

                  So why don't you use the 'Change' button next to Environment to add the path to rcc.exe?

                  A Offline
                  A Offline
                  Anyone700
                  wrote on last edited by Anyone700
                  #15

                  @aha_1980 The solutions discussed in the other thread appear to be in a different window. To use the one you led me to, I would need a command line.

                  Visual community, Dev C++, Code Blocks, and RAD studio all run without this problem.

                  0_1530567307792_Capture.PNG

                  @J.Hilk said in LNK1158: cannot run 'rc.exe':

                  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

                  kkoehneK 1 Reply Last reply
                  0
                  • A Anyone700

                    @aha_1980 The solutions discussed in the other thread appear to be in a different window. To use the one you led me to, I would need a command line.

                    Visual community, Dev C++, Code Blocks, and RAD studio all run without this problem.

                    0_1530567307792_Capture.PNG

                    @J.Hilk said in LNK1158: cannot run 'rc.exe':

                    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

                    kkoehneK Offline
                    kkoehneK Offline
                    kkoehne
                    Moderators
                    wrote on last edited by
                    #16

                    @Anyone700, Open the "Edit Environment" field for your kit and put

                    PATH=${PATH};C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x64
                    

                    there. Anyhow, this shouldn't really be necessary; Qt Creator sets the right paths itself by executing the Visual Studio Command Prompt (or rather: vcvarsall.bat) once, and extracting the PATH from there. Hence my request to check whether the path is correctly set in your Visual Studio Command Prompt.

                    Director R&D, The Qt Company

                    A 1 Reply Last reply
                    1
                    • kkoehneK kkoehne

                      @Anyone700, Open the "Edit Environment" field for your kit and put

                      PATH=${PATH};C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x64
                      

                      there. Anyhow, this shouldn't really be necessary; Qt Creator sets the right paths itself by executing the Visual Studio Command Prompt (or rather: vcvarsall.bat) once, and extracting the PATH from there. Hence my request to check whether the path is correctly set in your Visual Studio Command Prompt.

                      A Offline
                      A Offline
                      Anyone700
                      wrote on last edited by Anyone700
                      #17

                      @kkoehne It works now. Before I go ahead and close this, I would like to figure out why this is happening and what I can do to make it never happen again. For anyone.

                      Here is what happens when I run those commands:
                      0_1530618190128_Capture.PNG

                      jsulmJ 1 Reply Last reply
                      0
                      • A Anyone700

                        @kkoehne It works now. Before I go ahead and close this, I would like to figure out why this is happening and what I can do to make it never happen again. For anyone.

                        Here is what happens when I run those commands:
                        0_1530618190128_Capture.PNG

                        jsulmJ Online
                        jsulmJ Online
                        jsulm
                        Lifetime Qt Champion
                        wrote on last edited by
                        #18

                        @Anyone700 Looks good. Just the parameter -v is wrong and cl expects a source file as input which is missing.

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

                        A 1 Reply Last reply
                        0
                        • jsulmJ jsulm

                          @Anyone700 Looks good. Just the parameter -v is wrong and cl expects a source file as input which is missing.

                          A Offline
                          A Offline
                          Anyone700
                          wrote on last edited by Anyone700
                          #19

                          @jsulm So why did Qt not get the right settings on install? What else can I do to help?

                          aha_1980A 1 Reply Last reply
                          0
                          • A Anyone700

                            @jsulm So why did Qt not get the right settings on install? What else can I do to help?

                            aha_1980A Offline
                            aha_1980A Offline
                            aha_1980
                            Lifetime Qt Champion
                            wrote on last edited by
                            #20

                            @Anyone700

                            I still think you have some weird setup problem.

                            In your first post, you have MSVC2015, but in your screenshot you have MSVC2017.

                            Your developer command prompt works, so it should work in Creator too. We had some problems when running the .bat took excessive long, that may also be a problem.

                            Another Windows typical problem is, if PATH contains invalid directories, following (valid) directories may be ignored.

                            Hard to tell from my side whats going on on your system.

                            Qt has to stay free or it will die.

                            A 1 Reply Last reply
                            0
                            • aha_1980A aha_1980

                              @Anyone700

                              I still think you have some weird setup problem.

                              In your first post, you have MSVC2015, but in your screenshot you have MSVC2017.

                              Your developer command prompt works, so it should work in Creator too. We had some problems when running the .bat took excessive long, that may also be a problem.

                              Another Windows typical problem is, if PATH contains invalid directories, following (valid) directories may be ignored.

                              Hard to tell from my side whats going on on your system.

                              A Offline
                              A Offline
                              Anyone700
                              wrote on last edited by Anyone700
                              #21

                              @aha_1980 The cause is moot, Qt fails expected behavior. I would argue that this is not an important bug to fix as it effects few users and has an easy fix. However it should be listed so the community can decide if it wants to fix it. I will re-list this issue with the new information found here, mark this as solved as it found a fix, and will continue to provide help figure this out here: https://bugreports.qt.io/browse/QTCREATORBUG-20637

                              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