How do I install MinGW for use in MATLAB?

83 ビュー (過去 30 日間)
MathWorks Support Team
MathWorks Support Team 2016 年 11 月 21 日
編集済み: Stefanie Schwarz 2025 年 4 月 4 日
How do I install MinGW for use in MATLAB?

採用された回答

MathWorks Support Team
MathWorks Support Team 2021 年 8 月 18 日
編集済み: MathWorks Support Team 2021 年 2 月 15 日
The recommended way is to install the Support Package "MATLAB Support for MinGW-w64 C/C++ Compiler". You can install this support package in two ways:
  1. In MATLAB, on the "Home" tab, click Add-Ons. In the pop-up window, search for the term "mingw" then click "MATLAB Support for MinGW-w64 C/C++ Compiler". Choose the install option and follow the steps for installation.
  2. Go to the following page on MathWorks File Exchange: https://www.mathworks.com/matlabcentral/fileexchange/52848-matlab-support-for-mingw-w64-c-c-compiler Click the Download button. This downloads a "mingw.mlpkginstall" file. Double click this file and follow the steps for installation.
FAQ: This link provides answers to many frequently asked questions about installing the MinGW compiler:
  2 件のコメント
dpb
dpb 2025 年 3 月 26 日
編集済み: dpb 2025 年 3 月 26 日
Option 1. above links to a version that was last built in 2018 and is broke...this answer needs to be updated. I wasted half of yesterday afternoon tracking down the last release (up to 14. something now).
Neither gcc nor gfortran could successfully compile a trivial "hello world" file with the above; something is missing; it generates a "file not found" message somewhere in the link step.
The link to install mex support results in
>> !C:\ProgramData\MATLAB\SupportPackages\R2021b\3P.instrset\mingw_w64.instrset\bin\gcc --version
gcc (x86_64-posix-seh-rev2, Built by MinGW-W64 project) 6.3.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>>
It was built in 2016!!! Whassup with this???
At least it does compile, but who knows how many/what bugs have been fixed since then besides the newer features incorporated...
Stefanie Schwarz
Stefanie Schwarz 2025 年 4 月 4 日
編集済み: Stefanie Schwarz 2025 年 4 月 4 日
The MinGW installation instructions provided here are specifically for use with MATLAB/Simulink. As of R2024b we support no version later than 8.1. Refer to the supported versions table provided on the File Exchange page.
You can also install a supported version of MinGW from mingw-w64.org and link it with your MATLAB installation as explained here:
I'm sorry for any inconvenience that this has caused and we will update this answer accordingly.

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

その他の回答 (0 件)

製品


リリース

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by