I am trying to use the MSVC build tools inside of VS Code, and as such wanted to use the developer command prompt as an integrated shell.
My current approach was to add a terminal profile and pass the arguments \k "Path/to/VisualStudio\\2019\\Community\\Common7\\Tools\\VsDevCmd.bat"
, which works for manually using the terminal.
Unfortunately, this doesn't work with any Tasks, e.g. NMAKE (which I planned on using).
Executing an NMAKE (or any other programm) in a task results in the following error:
> Executing task in folder C-Project: nmake -f ../Makefile.mk <
[ERROR:parse_cmd.bat] Invalid command line argument: '/d'. Argument will be ignored.
[ERROR:parse_cmd.bat] Invalid command line argument: '/c'. Argument will be ignored.
[ERROR:parse_cmd.bat] Invalid command line argument: 'nmake'. Argument will be ignored.
[ERROR:parse_cmd.bat] Invalid command line argument: '-f'. Argument will be ignored.
[ERROR:parse_cmd.bat] Invalid command line argument: '../Makefile.mk'. Argument will be ignored.
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.11.1
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************
[ERROR:VsDevCmd.bat] *** VsDevCmd.bat encountered errors. Environment may be incomplete and/or incorrect. ***
[ERROR:VsDevCmd.bat] In an uninitialized command prompt, please 'set VSCMD_DEBUG=[value]' and then re-run
[ERROR:VsDevCmd.bat] vsdevcmd.bat [args] for additional details.
[ERROR:VsDevCmd.bat] Where [value] is:
[ERROR:VsDevCmd.bat] 1 : basic debug logging
[ERROR:VsDevCmd.bat] 2 : detailed debug logging
[ERROR:VsDevCmd.bat] 3 : trace level logging. Redirection of output to a file when using this level is recommended.
[ERROR:VsDevCmd.bat] Example: set VSCMD_DEBUG=3
[ERROR:VsDevCmd.bat] vsdevcmd.bat > vsdevcmd.trace.txt 2>&1
It the command prompt is not yet initialized while the task is already trying to execute the command. I tried writing a batch script that first waits and then executes the command, but calling a batch script in the an uninitialized state just results in a syntax error, followed by the terminal shutting down.
Are there any solutions or workarounds for this?
\
and/
in your actual code, do you? On Windows\
should be used… – Osana