Cannot properly setup the environment: cl not found

Mardy's Avatar


28 Dec, 2017 12:37 PM

  I started creating a project ( using the msvc2017 image. But I cannot get it to work, because the compiler is not being found. I'm using the web interface to configure my project, and in my build script (PS) I have this:
& "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"

When the build is run, this is the output:
** Visual Studio 2017 Developer Command Prompt v15.5.2
** Copyright (c) 2017 Microsoft Corporation
[vcvarsall.bat] Environment initialized for: 'x64'
cl : The term 'cl' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:2 char:1
+ cl
+ ~~
    + CategoryInfo : ObjectNotFound: (cl:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

How should I setup the environment so that the compiler is added to the path? The documentation says to use "call", but PS complains that it's not a valid command; that's why I'm using '&'. Are they equivalent?

  1. Support Staff 1 Posted by Ilya Finkelshte... on 28 Dec, 2017 06:25 PM

    Ilya Finkelshteyn's Avatar

    Is there any specific reason to run those commands as PowerShell and not as CMD?

  2. 2 Posted by Mardy on 28 Dec, 2017 08:36 PM

    Mardy's Avatar

    No, not really. I just thought that PS is more powerful and that would allow me to write more complex scripts, but yeah, I can try using CMD.

  3. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:25 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac