Why do I get the error "After running VCVARSALL.BAT, the updated path must contain the original path" when generating code?

20 views (last 30 days)
I am trying to generate C/C++ code from MATLAB/Simulink and compile it using Visual Studio.
​The build works in R2021b, but does not go through in 2022a. I get the following error message in the build log​:
After running VCVARSALL.BAT, the updated path, "<updated path>" must
contain the original path, "PATH=<original path>"
What is the cause of this error and how can it be resolved?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 5 Oct 2022
This is due to the fact that the original path processed in the VCVARSALL.BAT file contains an entry with an incorrect encoding.
To resolve this, please reconfigure the incorrect entry in the system's environment path with the proper character encoding.
You can do this in Windows OS as follows:
1. Search for 'Edit the System Environment Variables' using Windows Search.
2. Click 'Environment Variables ...'.
3. In the 'System variables' section, double-click the 'Path' variable.
4. Delete/Fix any path that contains special characters 
(Note: special characters in the path result in the incorrect encoding)
5. Save the change by clicking OK.
6. Open Windows Command Prompt as Administrator
7. Type 'path' to confirm the new path contains the newly added entry in step 5
8. Launch MATLAB and re-run the compilation.

More Answers (0)

Categories

Find more on MATLAB Coder in Help Center and File Exchange

Tags

No tags entered yet.

Products


Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!