problems with C/C++ compiler. Matlab R2022b

4 ビュー (過去 30 日間)
Jorge Garcia Garcia
Jorge Garcia Garcia 2023 年 5 月 10 日
コメント済み: Tushar 2023 年 5 月 17 日
Hello.
I downloaded the suggested app (cannot honestly remember the name) and then in the command window i typed:
mex -setup
mex -setup C
but still it keeps on giving the the error:
A C/C++ compiler has not been selected with mex -setup
Any suggestions?
  1 件のコメント
Jorge Garcia Garcia
Jorge Garcia Garcia 2023 年 5 月 10 日
Just remembered the addon: MinGw-w64

サインインしてコメントする。

採用された回答

Tushar
Tushar 2023 年 5 月 15 日
Hi,
This can be because of the reason that you don't have a compiler installed on your system.
So, first you need to install the compiler.
To install the MinGW-w64 compiler, use the Add-Ons menu.
  • On the MATLAB Home tab, in the Environment section, click Add-Ons > Get Add-Ons.
  • Search for MinGW or select from Features.
If you only have the MinGW compiler installed on your system, the "mex" command automatically chooses MinGW. Go to the next step. However, if you have multiple C or C++ compilers, use the below command to choose MinGW.
mex -setup
Also, it might be possible that you already have a compiler installed, but it's installation path might not be correct, so you can also have a look at the same.
Now you can build the MEX files, like:
mex myProgram.c
Hope it helps!
  2 件のコメント
Jorge Garcia Garcia
Jorge Garcia Garcia 2023 年 5 月 16 日
It did help!!! much appreciate it!
Tushar
Tushar 2023 年 5 月 17 日
@Jorge Garcia Garcia Thank you! If you find this answer helpful, please mark it as accepted so others can benefit from it too.

サインインしてコメントする。

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by