Visual Studio MSVC Tool Chain Error: Cannot load Visual Studio Code 2019 environment

Completed

I have Visual Studio  2019 Community Installed and I try to use the build tools and get the following:

Visual Studio not found at: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community

Cannot load Visual C++ environment from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat 

 

 

 

0
11 comments

Discussed with the user via email.

-4
Avatar
Permanently deleted user

I have a comparable issue where it randomly gives this error in configuring CMake 

Sometimes it works, sometimes it doesn't. It has done this for a very long time across MSVC installations.

0

Please send the idea.log file (`Help | Show Log in ...`) to clion-support at jetbrains.com when the issue occurs again. Note that logs might contain private user's information (like file paths and names). 

0
Avatar
Permanently deleted user

I have the same issue when trying to configure with VS 2017 Community or VS 2019 Community.

0

@Ovidiu, please send the idea.log file as requested in my previous comment.

0
Avatar
Permanently deleted user

I also have the same issue. It started appearing a few days ago.

0

Hello everyone! 

Please comment https://youtrack.jetbrains.com/issue/CPP-18206 and attach the idea.log there. You can attach it privately (with visibility to CLion team), the instruction is here.

0
Avatar
Permanently deleted user

Installed the fresh CLion 2020, already having MSVC 2019 Community (working perfectly). Opened a simple cmake project, configured a Visual Studio CMake profile, and got this:
```

com.intellij.execution.ExecutionException: Cannot load Visual C++ environment from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat:
command [cmd.exe, /c, call, C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat, x86, 8.1, &&, C:\Program Files\JetBrains\CLion 2020.1\jbr\bin\java, -cp, C:\Program Files\JetBrains\CLion 2020.1\lib\util.jar, com.intellij.util.ReadEnv, C:\Users\mshevchenko\AppData\Local\Temp\intellij-cmd-env.tmp, ||, exit, /B, %ERRORLEVEL%]
exit code:0 text:0 out:**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.5.4
** Copyright (c) 2019 Microsoft Corporation
**********************************************************************
[ERROR:winsdk.bat] Windows SDK 8.1 : 'include' not found
The system cannot find the path specified.
[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

[Failed to reload]
```

0

@Mike, thanks for describing the issue in the comments to https://youtrack.jetbrains.com/issue/CPP-18206. The responsible developer will communicate with you there.

0

I also encountered this problem, and finally I found out that it was because I changed the default code page of CMD (chcp 65001), which caused the vcvarsall.bat run incorrectly. After deleting the '[HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\Autorun]' value, CLion worked fine.

0

Similar problem c++ Compiler.

cMake run with errors :C

 

0

Please sign in to leave a comment.