vcvarsall.bat command not working on TCC LE command prompt

Nov 25, 2019
1
0
whenever we are invoking vcvarsall.bat("C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build)
from windows command promptn then script is working fine while using TCC LE it is give below error-

TCC LE Log--
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build:>vcvarsall.bat amd64
[ERROR:vcvarsall.bat] Error in script usage. The correct usage is:
Syntax:
vcvarsall.bat [arch] [platform_type] [winsdk_version] [-vcvars_ver=vc_version] [-vcvars_spectre_libs=spectre_mode]
where :
[arch]: x86 | amd64 | x86_amd64 | x86_arm | x86_arm64 | amd64_x86 | amd64_arm | amd64_arm64
[platform_type]: {empty} | store | uwp
[winsdk_version] : full Windows 10 SDK number (e.g. 10.0.10240.0) or "8.1" to use the Windows 8.1 SDK.
[vc_version] : {none} for latest installed VC++ compiler toolset |
"14.0" for VC++ 2015 Compiler Toolset |
"14.xx" for the latest 14.xx.yyyyy toolset installed (e.g. "14.11") |
"14.xx.yyyyy" for a specific full version number (e.g. "14.11.25503")
[spectre_mode] : {none} for libraries without spectre mitigations |
"spectre" for libraries with spectre mitigations

The store parameter sets environment variables to support Universal Windows Platform application
development and is an alias for 'uwp'.

For example:
vcvarsall.bat x86_amd64
vcvarsall.bat x86_amd64 10.0.10240.0
vcvarsall.bat x86_arm uwp 10.0.10240.0
vcvarsall.bat x86_arm onecore 10.0.10240.0 -vcvars_ver=14.0
vcvarsall.bat x64 8.1
vcvarsall.bat x64 store 8.1

Please make sure either Visual Studio or C++ Build SKU is installed.
 
I have had this problem with TCC up to and including version 25.

I just run the command prompt from the start menu via a shortcut key combination (Ctrl-Alt-C in my case);

1577197548838.png

...and from there, I start TCC, which inherits the environment from CMD;

1577197719418.png

or, for TCC/LE;

1577197939724.png

Joe
 
Here's my TCC Startup Dialog;

1577214545657.png

Same result with "Duplicate CMD. EXE bugs" enabled or disabled.

Code:
e:\utils>ver

TCC  25.00.24 x64   Windows 10 [Version 10.0.18362.476]

e:\utils>alias vc64
"E:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
Many errors occur here. See file at Firefox Send

Code:
e:\utils>type %@alias[vc64]


@call "%~dp0vcvarsall.bat" x64 %*

e:\utils>
I tried to include the output in this message, but I kept getting the dialog;

1577215688419.png

...so the output is available at Firefox Send

Joe
 
May 20, 2008
10,280
73
Syracuse, NY, USA
I don't understand; it looks crazy to me. The output in the FirefoxSend document doesn't look like any batfile output I've ever seen. Many of the words in it aren't even in VCVARSALL.BAT. Did that really appear in the console when you ran VC64?

Do you have this?

Code:
2019-12-04  11:40              39  vcvars32.bat
2019-12-04  11:40              39  vcvars64.bat
2019-12-04  11:40           9,859  vcvarsall.bat
2019-12-04  11:40              43  vcvarsamd64_x86.bat
2019-12-04  11:40              43  vcvarsx86_amd64.bat
 
Yepper, @vefatica , that was the output in the console when I ran VC64.

Looks like I have the same .bat files as you;
Code:
e:\program files (x86)\microsoft visual studio\2019\community\vc\auxiliary\build>dir *.bat

 Volume in drive E is New Volume   Serial number is 2c1e:6e61
 Directory of  E:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\*.bat

2019-12-06  14:04              39  vcvars32.bat
2019-12-06  14:04              39  vcvars64.bat
2019-12-06  14:04           9,859  vcvarsall.bat
2019-12-06  14:04              43  vcvarsamd64_x86.bat
2019-12-06  14:04              43  vcvarsx86_amd64.bat
              10,023 bytes in 5 files and 0 dirs    28,672 bytes allocated
   1,475,359,248,384 bytes free
Joe
 
May 20, 2008
10,280
73
Syracuse, NY, USA
Many of the words in that FirefoxSend document are coming from "@REM" statements in VCVARSALL.BAT and in

Code:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat
 
May 20, 2008
10,280
73
Syracuse, NY, USA
Yepper, @vefatica , that was the output in the console when I ran VC64.
... the likes of this ... literally ... really? I've never seen anything like it. All the strings after "Syntax error - " are the first words of an @REM statement. And they don't look like TCC error messages. Any idea where they come from?

Code:
e:\utils>vc64
Syntax error - -------------------------------------------------------------------------
Syntax error - Parse
Syntax error - argument
Syntax error - called
Syntax error - 1.
Syntax error - 2.
Have you looked for

Code:
vsdevcmd.trace.txt
Did you notice that the last line in results.txt is

Code:
[vcvarsall.bat] Environment initialized for: 'x64'
 
May 20, 2008
10,280
73
Syracuse, NY, USA
Here's results.txt without all the (crazy) syntax errors.

Code:
e:\utils>vc64
The filename, directory name, or volume label syntax is incorrect.

The filename, directory name, or volume label syntax is incorrect.

The filename, directory name, or volume label syntax is incorrect.

Bad command or filename - vswhere.exe
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.0
** Copyright (c) 2019 Microsoft Corporation
**********************************************************************
[ERROR:VsDevCmd.bat] Cannot find 'ext' folder "E:\Utils\vsdevcmd\ext\"
[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
[vcvarsall.bat] Environment initialized for: 'x64'
 
May 20, 2008
10,280
73
Syracuse, NY, USA
This is a little silly.

Code:
v:\> alias REM `echo Syntax error - %@word[0,%$]`

v:\> vc64 | head /n 13
Syntax error - -------------------------------------------------------------------------
Syntax error - Parse
Syntax error - argument
Syntax error - called
Syntax error - 1.
Syntax error - 2.
Syntax error - Architecture
Syntax error - --
Syntax error - Mostly
Syntax error - the
Syntax error - being
Syntax error - Windows
Syntax error - Store/UWP
 
Well @vefatica , I have discovered what was causing the problem of running the VCVARS64.BAT file, and I'm quite embarrassed, but amazed.

I had been testing the ReactOS cmd exe a few years ago, and it was still in my path.

Removing the ReactOS cmd exe from my path results in;
Code:
e:\utils>vc64
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.4.2
** Copyright (c) 2019 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
So, whenever I have been using cmd exe for the past few years, I have been using the React OS cmd exe, of which this is the only problem I have had.

Joe
 
May 20, 2008
10,280
73
Syracuse, NY, USA
Doesn't that version of CMD like @REM statements?

How was it being invoked when running VC64 from TCC? I tried to see if CMD was invoked when running VC64 from TCC. I didn't see it in TaskMgr but that doesn't mean it didn't get called.
 
Code:
     _x64: 1
   _admin: 1
_elevated: 1

TCC  25.00.24 x64   Windows 10 [Version 10.0.18362.476]
BuildNumber  Caption                   CSDVersion  OSArchitecture  Version
18362        Microsoft Windows 10 Pro              64-bit          10.0.18362
So, I have TEST.BAT;
Code:
e:\utils>type test.bat
echo %comspec%
pause
...and the following settings...
Code:
e:\utils>assoc .bat
.bat=batfile

e:\utils>ftype batfile
batfile="C:\Program Files\JPSoft\TCMD25\TCC.EXE" /c "%1" %*
When I do;
Code:
call test.bat
from TCC, it returns
Code:
echo C:\WINDOWS\system32\cmd exe
(Note that I had to remove the . from cmd exe in order to post this message)

So, why, when I do call to a .BAT, does CMD become the comspec, instead of TCC?

Joe
 
May 20, 2008
10,280
73
Syracuse, NY, USA
So, why, when I do call to a .BAT, does CMD become the comspec, instead of TCC?
Beats me. Here the default for BATs is CMD. But when I run (or CALL) one from TCC is says COMSPEC ic TCC.

Code:
v:\> assoc .bat
.bat=batfile

v:\> ftype batfile
batfile="%1" %*

v:\> type atrem.bat
echo %comspec
pause

v:\> atrem.bat
D:\tc25\TCC.EXE
Press any key when ready...

v:\> call atrem.bat
D:\tc25\TCC.EXE
Press any key when ready...
 
Mar 16, 2020
1
0
Turns out the real problem here is the same as this thread.

The vcvarsall.bat file has a FOR with IF nested in it used to parse input arguments. The loop pulls them out. The IF determines if some debug output should be echoed out. After the echo, the argument is actually parsed. When the IF failed because debug output was not enabled, it terminated the subroutine early and did not parse the argument value. Re-configuring TCC to not emulate cmd bugs resolved the issue.