Why do I get the error "'C:\Program' is not recognized as an internal or external command" when using MinGW compiler?

I am trying to use a workflow in MATLAB or Simulink that involves a C/C++ compiler. I've selected MinGW as my compiler as per the "mex -setup" command.
However, I get the following error:
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
Instead of 'C:\Program', the error message may mention a different incomplete path.

 採用された回答

MathWorks Support Team
MathWorks Support Team 2023 年 5 月 3 日
編集済み: MathWorks Support Team 2023 年 5 月 3 日
This error may be due to a known issue that MinGW does not work if installed in a path that contains spaces, such as:
C:\Program Files\mingw-64
Instead, use:
C:\mingw-64
The recommendation is stated on this documentation page:  
To see where MinGW is installed on your computer, in your MATLAB command prompt, try:
>> getenv('MW_MINGW64_LOC')
Try installing MinGW using the Add-On manager from within MATLAB if you have not done already. This will ensure it is correctly configured and also does not contain white space in the file path of the installation. For more information, see "MATLAB Support for MinGW-w64 C/C++ Compiler".

その他の回答 (0 件)

製品

リリース

R2021a

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by