Qt cannot find rc.exe Codes: fatal error RC1106: invalid option: -ologo, LNK1327 / LNK1158 : fatal error during running rc.exe
-
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 -vIf you can run these commands successfully, it at least means your Visual Studio installation is complete.
-
@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
-
Tools > Options > Build&Run > Kits > «Your MSVC Kit» > Build Environment
-
@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?
-
@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.
@J.Hilk said in LNK1158: cannot run 'rc.exe':
hi, @zzzhhhzzzhhh
pleasemake sure, that the WindowsKit bin folder is part of your Build Environment
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
-
@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.
-
@Anyone700 Looks good. Just the parameter -v is wrong and cl expects a source file as input which is missing.
-
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.
-
@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