Cannot properly setup the environment: cl not found

Mardy's Avatar

Mardy

28 Dec, 2017 12:37 PM

Hi!
  I started creating a project (https://ci.appveyor.com/project/mardy/photokinesis) 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"
cl
```

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.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? 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