Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

System Cannot Find Path Specified



  • Hello, for some reason last week whenever I qmake and build any project, no matter how basic, it returns:

    The system cannot find the path specified.
    Could Not Find C:[path]\fmi\debug\qrc_image.cpp
    	del debug\moc_predefs.h
    
    The system cannot find the path specified.
    'cl' is not recognized as an internal or external command,
    operable program or batch file.
    jom: C:[path]7\fmi\Makefile.Debug [debug\coverage.obj] Error 1
    ......
    The system cannot find the path specified.
    'cl' is not recognized as an internal or external command,
    operable program or batch file.
    jom: C:[path]\fmi\Makefile.Debug [debug\footprintOverlay.obj] Error 1
    The system cannot find the path specified.
    'cl' is not recognized as an internal or external command,
    operable program or batch file.
    jom: C:[path]\fmi\Makefile.Debug [debug\main.obj] Error 1
    The system cannot find the path specified.
    
    'cl' is not recognized as an internal or external command,
    

    Every file it says it cannot find I can find through use of Windows Explorer.
    I also get the same message through Developer Command Prompt for all versions of VS, so very possible this is a Visual Studio error:
    c1e3f897-1ff1-4fdf-8755-43b58c60b6bb-image.png
    There is no download or install error for VS initially or when repairing.
    I also have a caution warning for the kits showing:
    feffd41f-7072-46aa-8394-831525a6fc75-image.png

    I have run, modified, verified, etc the vcvarsall.bat file to no avail. When running vcvarsall.bat it states at the end of the short execution before exiting cmd:
    db751c8c-6094-4dfa-a82b-353a74fe57a8-image.png
    I have also verified the OS PATH and the path variable for the kit. Maybe there is a directory I am missing?

    I have looked up and tried 30+ solutions of others that have had similar issues online, and cannot find a solution that works for me.
    I have uninstalled and reinstalled multiple versions of VS and QT Creator.

    I have had this issue since last Thursday and no idea why it started to occur.
    I am currently running VS 2019 Community and Qt Creator 4.12.4.

    Is there a list of possible solutions I can try to fix this? Thank you so much!



  • Hi, perhaps some PATH problem, try this:
    Open a normal, vanilla CMD (not a developer CMD) and type these 2 lines:

    set path=
    "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
    

    Paste the output here
    (if successful, the .bat file should complain about Powershell is missing, but also say: [vcvarsall.bat] Environment initialized for: 'x64'



  • @hskoglund Thank you so much for the reply.
    I tried all variations of your request. The results are:
    313218c3-80e7-491b-a8c4-267d2b627959-image.png

    It is very interesting that CMD starts off before any command by saying "The system cannot find the path specified."



  • @surferbrain
    How do you actually run/invoke this CMD? It sounds like it's trying to run something at start-up, before it gets going? I note from running cmd /? it includes:

    /D Disable execution of AutoRun commands from registry (see below)

    so that is an example showing CMD can be running something when it starts.



  • @JonB I pressed the Win key, typed cmd, and pressed Enter:
    1ea738aa-7150-43dd-88f6-da723d01262b-image.png



  • Hi, the 2nd attempt was the one I was thinking of (set path= on one line, and vcvarsall.bat on the next line)

    Now in that same CMd, (after the 2 lines that ends with .. initialzed for x64) try typing
    cl

    Does it say Microsoft Visual ... or?



  • @surferbrain
    If you type the command

    cmd
    

    from within your Command Prompt, it will start a new one inside the current one. Output should look like:

    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
    
    C:\Users\Jon>cmd
    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
    
    C:\Users\Jon>
    

    But are you saying that after that cmd inside the Command Prompt you get your
    The system cannot find ...
    message as it starts the second shell level?



  • @hskoglund Hi, typing cl after shows:
    82a2a341-ba50-49aa-8191-a85544780d9c-image.png
    Maybe now I should try Qt Creator and see if it still creates those cl errors.

    @JonB Yup! Even invoking cmd within cmd produces the error:
    fe67f709-32c8-48c3-a1da-a00b36411f65-image.png



  • @surferbrain
    I am only commenting on the The system cannot find .... If it were me I would want to track that down and deal with it. However, whatever it is it may be harmless or not related to your Qt situation.

    Yes, try ignoring it for now and proceeding....



  • You seem to have been bitten by PATH poisoning (i.e. some other program is interfering with MSVC)

    To be able to pull the same stunt from Qt Creator you will have to launch Qt Creator from that same CMD that has the neutered path (or find a way to do it inside Qt Creator)



  • I'm wondering, I found some directories that did not exist in my system environment variables. I deleted or modified them to work. I am wondering now if the System Environment path variable in my stock kit looks correct. I would assume it is:
    Untitled.png

    @JonB Qt Creator still produces the same errors. It does say that perhaps:
    92dad112-e6d9-4417-a29d-7ec98bdb3976-image.png
    but we already knew the environment is probably screwed up in some fashion.



  • Hmm, the PATH looks kosher, maybe it's time to clean those Visual Studios, try keep only one of them (MSVC2019) and uninstall the others (MSVC2017 etc.) Then start MSVC2019 and update it to version 16.6.4.



  • @hskoglund Thank you for your help.
    I currently only have VS 2019 Community and Qt Creator 4.12.4 installed. They were installed after uninstalling all instances of VS and Qt.
    I just updated to 16.6.4 and it still produces the same errors/warnings. Ex:
    f7c7a3da-c354-4748-89e5-1acb73cb66ca-image.png



  • Does anyone else have any possible solutions, besides reinstalling Windows?



  • Hi, maybe you can use Qt Creator through my suggestion before (i.e. launch a normal (not a Developer) CMD window) and type these 3 lines:

    set path=
    "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
    C:\Qt\Tools\QtCreator\bin\qtcreator.exe
    

    If you can compile nside Qt Creator now, you could put those 3 lines a .bat file...



  • @surferbrain
    You need to look inside that vcvarsall.bat file and see what paths it is trying to find/execute which cannot be found. Isn't the problem in your VS set up rather than Creator?