QtCreator delays/issues on Windows



  • I'm trying to get Qt working on a Windows 7 system and experiencing problems that I've not seen before. On starting QTCreator I get long delays followed by 2 repeated messages in the Issues window:

    :-1: error: Failed to retrieve MSVC Environment from "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat amd64":
    The command "C:\Windows\system32\cmd.exe" could not be started.

    These long delays and messages re-occur whatever I try to do it seems.

    My environment:

    QtCreator 4.5.1 (Based on Qt 5.10.1 (MSVC 2015, 32 bit))
    Qt 5.10.1 MSVC2017 64bit- via unified installer x86-3.0.2
    Microsoft Windows SDK for Windows 7 (7.1) 7.1.7600.0.30514

    Having persisted through all the long delays it does actually seem to have built my simplest projects but the delays etc are going to make it VERY difficult to use.

    Any help appreciated in getting to the root of and removing these.

    Thanks

    Steve



  • Hi, did you also install the MSVC2017 compiler?


  • Qt Champions 2017

    Hi @SteveK

    your problem sounds a bit like QTCREATORBUG-18976, which also mentions vcvars.bat.

    Regards



  • @hskoglund Sorry, yes I also installed professional edition of Visual Studio 2017.



  • @aha_1980 Yes it does if not identical. There are number of similar issues I've found. After much frustration and following an snippet in https://bugreports.qt.io/browse/QTCREATORBUG-19099 I tried turning of the organisation's installed Sophos services (anti virus etc) and this seems to stop the qtcreator problem occuring. However others in the organisation run with this without qtcreator problem. It isn't a long term solution to turn this off unfortunately so trying to track down a proper understanding of what causes the problem.

    Folowing QTCREATORBUG-18976 as mentioned by @aha_1980 I have downloaded DebugView and run qtcreator -profile. The following seems to essentially confirm the problem as indicated by the qtcreator Issues messages but may provide further insight. In my naive Windows view it looks like something is trying to run cmd.exe which is taking forever to return or not running. The time data doesn't seem to have copied properly but each of the 2 cmd.exe invocations seem to be given about 30 seconds.

    Is it correct to think that qtcreator is trying to run cmd.exe? For what reason, to get environment date perhaps?

    [7360] <delayedInitialize CppTools 1701ms ( 0ms)
    [7360] >delayedInitialize ProjectExplorer 1701ms ( 0ms)
    [7360] The command "C:\Windows\system32\cmd.exe" could not be started.
    [7360] QProcess: Destroyed while process ("C:\Windows\system32\cmd.exe") is still running.
    [7360] The command "C:\Windows\system32\cmd.exe" could not be started.
    [7360] QProcess: Destroyed while process ("C:\Windows\system32\cmd.exe") is still running.
    [7360] No tool chain set up in kit "Desktop" for "C".
    [7360] No tool chain set up in kit "Desktop" for "C++".
    [7360] No tool chain set up in kit "Desktop" for "C".
    [7360] No tool chain set up in kit "Desktop" for "C++".
    [7360] <delayedInitialize ProjectExplorer 62781ms ( 61080ms)
    [7360] >delayedInitialize TextEditor 62804ms ( 23ms)


  • Moderators

    @SteveK If turning off Sophos solves the issue then Sophos is the problem. You need to tell Sophos to not to block QtCreator or other tools like compiler (I don't know how as I never used Sophos).


  • Qt Champions 2017

    Hi @SteveK,

    Is it correct to think that qtcreator is trying to run cmd.exe? For what reason, to get environment date perhaps?

    Creator runs vcvars32.bat which detects the Visual Studio compilers to know which Visual Studio compilers are available.

    I've seen some problems with this mechanism recently, most often because the bat script takes very long time to finish. Some Users talk about minutes. Normally it should take less than 5 seconds. You can try yourself by calling the "Visual Studio Command Prompt" by Windows Start Menu.

    You can also comment to the bugreport to tell you are effected too, and you can search here in the forum, I remember we had similar issues here and some users managed to solve the problems.



  • @jsulm That's an opinion that I have a fair amount of sympathy with right now, trust me. Various things to Sophos's list of exclusions on my behalf but none seem to be solving the problem as yet.



  • @aha_1980 Thanks again. Yes I'd seen various things of this nature. Do you mean vcvars32.bat rather than vcvarsall.bat? The latter is referred to in the qtcreator Issue. Not tried the former as a sophos exclusion yet. I've tried vcvars32.bat and "vcvarsall.bat amd64" from the qtcreator command prompt but both return in just a few seconds. I will try more searching in this forum.


  • Qt Champions 2017

    @SteveK said in QtCreator delays/issues on Windows:

    Do you mean vcvars32.bat rather than vcvarsall.bat?

    Maybe I confused these bat files; I just know that one is run by another. Please use what is referenced in the reports.

    I've tried vcvars32.bat and "vcvarsall.bat amd64" from the qtcreator command prompt but both return in just a few seconds. I will try more searching in this forum.

    Can you try to run the batch file from outside Creator? Ideally after booting the system. I have the strange feeling that there is some "caching" involved.

    Otherwise I cannot help you much further, I don't have this problem and don't really know how to proceed.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.