File Exchange

image thumbnail

MATLAB Support for MinGW-w64 C/C++ Compiler

Install the MinGW-w64 C/C++ compiler for Windows


Updated 16 Sep 2020

Editor's Note: Popular File 2016 2017 2018

This support package is currently unable to download third-party software for MATLAB R2017a and earlier versions. To install MinGW, complete the workaround instructions in the Bug Report, then return to this page and follow the instructions for R2017b and later.

MATLAB R2017b and later versions are unaffected.

MinGW-w64 is a compiler suite for Windows based on the GNU tool chain. It includes a GCC compiler and related tools for compiling C and C++ applications for Windows. C and C++ applications compiled with MinGW-w64 GCC can be called from MATLAB using MEX. This GCC compiler can also be helpful for other MathWorks products that require a C or C++ compiler.

Instructions for R2015b, R2016a, R2016b, and R2017a:
Complete the workaround instructions in the Bug Report, then follow the instructions, below, for R2017b and later.

Instructions for R2017b and later:
Select the download button, above, then double click on the file or drag it into the MATLAB Command Window to install.

FAQ: This link provides answers to some frequently asked questions.

This Add-On installs one of the following versions of MinGW GCC based on your version of MATLAB:
MATLAB version__________MinGW version__For more information
R2015b through R2017a____GCC 4.9.2_____
R2017b and R2018a_______GCC 5.3______
R2018b and later__________GCC 6.3______

See additional information on installing this compiler at:

Learn more about other compilers supported by MathWorks Products at:

If you are having difficulty installing, please contact Technical Support or see MATLAB Answers:

Comments and Ratings (588)



weihe liang


wei zhang


Oluwaseyi Ayeni

Please after downloading this compiler, how do I install it? Thanks in advance.

sugizono kohtaroh

I could not find a solution to the following error.
The answer page is not helping.
I am using 2019a.

Download error
There was a problem with downloading the support package, what should I do? Please refer to this MATLAB Answer for solutions.



Jean Ndo

旭东 李

wuhu qifei✈

得 夏

suitable for 2018b thanks!

hasan mohamadi kiani

hi.. do you have zip file

tommy mole

Yonglei GUI

I have a 2019b and have tried manually installing third party compilers TDM-GCC and MinGW64. 'mex -setup' executes correctly, but when it comes to executing the 'make' command, a red error message appears and it's an error in the undefined data type! What's the solution?

Shivam Kaushal

Please Provide the Workaround for R2013b

Shafaat Ullah

Shafaat Ullah

Shafaat Ullah

How to Install TDM-GCC Compiler (step-by-step)

Note: I have MATLAB R2017a

Step 1:
Visit the following link and install the latest version of the TDM-GCC Compiler (in my case the latest version available, as of 16/07/2020, was: TDM-GCC 9.2.0 release):


The default installation location will be: C:\TDM-GCC-64

Step 2:
In MATLAB command prompt, type and run:


Step 3:
In MATLAB command prompt, type and run:

mex -setup

And you are done with the stated compiler.

חגשךלדגח לשדחח גךשלן' נכנק םדן /פםד מגנ' כנשחד ךלגחחש דג el compiler ךדלחגגש חדזצמג מגחך פשדגםקצ

Jeffery Louis


songchuan zhang

Dingshan Sun


enli qian


mingxing Liao with error (-7).
it says this error bescuase my path included CN?
But my path is 'D:\mingw.mlpkginstall' Can someone help me? thank you.

shi xuezhang

It does not work with Amesim, can you help me?

chuang xu

同是2019b,安装您说的方法,还是无法下载第三方软件,不知道怎么回事@Zishuo chen

Mehran Baboli

It cannot be installed inside matlab. I don't understand why matlab does not provide the compiler as an opion to select when installing. This is a pain.

Manuel Krug

I don't get it why mathworks can not deliver a mex compiler with the nurmal matlab/simulink distribution. That would be a real quality of live improvement to not go though this pain of setting up a mex compiler every time you install a new matalb version.

Lucas Ribas

yinqing pei

For me, I had to download the compiler , and put it directly under C:\. Then drag the downloaded file into Matlab command window to execute it. I first put it inside a folder (without any space in the path), it didn't work. Also, I didn't have to turn off my firewall. Thanks for all the comments in this page, otherwise I couldn't have successfully installed it.

Prakash Chandra Panda

I am not able to download the compiler. I seek your support please help me in this regard

Zishuo chen

其次,请使用浏览器下载“ mingw.mlpkginstall”文件,并放入C盘根目录下,再将该文件拖入matlab命令行窗口,可以有效避免【无法下载第三方软件】问题。

junlin he


非常感谢楼下的Junshuang Jiang同学。确实是这样,无法下载第三方软件,解决办法就是再浏览器下载“mingw.mlpkginstall”,然后把这个东西拖到命令窗口,就能弹出安装,顺利进行。浏览器下载的mingw.mlpkginstall的路径中不能有空格!!!最后这一点要注意,我折腾了半个下午才发现这位同学说的对我才是有用的。

Ranajay Ghosh


so many interesting comments amused me


非常感谢楼下的Junshuang Jiang同学。确实是这样,无法下载第三方软件,解决办法就是再浏览器下载“mingw.mlpkginstall”,然后把这个东西拖到命令窗口,就能弹出安装,顺利进行。浏览器下载的mingw.mlpkginstall的路径中不能有空格!!!最后这一点要注意,我折腾了半个下午才发现这位同学说的对我才是有用的。

J Red

My computer can't connect to internet, how to download offline installation package

Junshuang Jiang

我懂了 在浏览器下载好那个东西后将其拖动至命令窗口 稍等一会就会弹出安装 然后一直顺利的进行下去就行了 但是问题是下载的那个东西的路径中不能含有空格 我第一次就卡在这了

Junshuang Jiang

*MinGW 6.3.0 from
何解???(how to solve it ?)

Hsin Jung Yu

Finally it works !!!

衡 张



Lao WuLve

open it by google

Abdulrahman AlHababi

Jun Kim


声明里提到了"This support package is currently unable to download third-party software for MATLAB R2017a and earlier versions"

Runmu Yang

关掉防火墙,重启matlab,在ADDon里搜索MinGW-w64 compiler,就可以了
Turn off the firewall, restart matlab, and search for MinGW-w64 compiler in ADDon, it's work



Donna Kaiser

Still getting errors installing for Matlab 2017b; nothing is working- huge time sink.

jay shah




Zhuang Fu


William Lambert

My MATLAB is 2019b:
Error using mex
exit 'C:\ProgramData\MATLAB\SupportPackages\R2019b\3P.instrset\mingw_w64.instrset\bin\gcc' , return "1"

jay shah

I am using 2019b version of matlab. it always shows "failed to download third party software" message.

jay shah

always showing "third party download issues". ANy suggestions?


Mengzhu 你可以試著打開matlab > addon 那搜 mingw 那裏直接安裝

meng zhu


captain C


Echo zeng

Call FOR HELP!!!
ANY IDEA how to install the compiler if there is no internet?

wei li

How to do that??
错误使用 mex
命令 'C:\ProgramData\MATLAB\SupportPackages\R2019a\3P.instrset\mingw_w64.instrset\bin\gcc' 已退
出,返回值为 '-1073741521'

ning li

let me see how many bupts are there in this comment zone

Michael Don

Using windows 10 with R2019a, I get this error, can you help me out?

>> mex yprime.c
Building with 'MinGW64 Compiler (C)'.
Warning: You are using an unsupported version of MinGW Compiler. To install the supported version of MinGW compiler, see:
Install MinGW-w64 Compiler.
For a list of currently supported compilers visit
Error using mex
Access is denied.

Janis Kan

For people confused:
1) When I clicked on link in Matlab, it opened a web browser that didn't process the download button right (just opened a new tab). I copied the link to the browser I usually use (Chrome) and it worked fine. 我用Matlab给的web browser点download也只弹出了空白窗口。用另外一个web browser(例如Chrome), 点了download后就弹出了选择下载path的窗口。
2) Once downloaded, you can't just double click it on windows explorer. You have to use Matlab to open it. Found this instruction in the file itself *facepalm*. Thanks, Notepad++! 下载后要用Matlab来运行那个档案。

Sorry for my horrible Chinese!

jiachun li

what a hell, it is just wasting time!!!!!!

Yunhong Che

求助,为什么我点了“download” 就只是弹出一个新的空白窗口,没有在下载啊


ryan syed

Chris Hills

Beware, even if you paid for the Compiler toolbox, if your subscription is not active this will not work!

abas salemi

Muneer Al Sabbagh

@xinghan yan probably in MATLAB\R2019b\extern\lib\win64\mingw64

Lei Gao

xinghan yan

What is the path where MinGW-w64 compiler is installed?I've installed MATLAB in C:\Program Files.

quan chen


gang qian

Liuhao Liuhao


Namwon Kim

@Lifeng Liu,
No problems. The mingw.mlpkginstall is a support package installer to install within MATLAB.

Lifeng Liu

The downloaded file is only 15 KB approximately. Is there anything wrong?

Namwon Kim

Please run the mingw.mlpkginstall file in MATLAB after move the file to a MATLAB work folder.

xiaopeng gao


View and run the file in MATLAB, not in Windows


Guanglin Li


haoyu wang

Zhixin Fang

Manual fix for third-party corruption:(Get undefined type 'uint_farptr_t' error)
1. Find inttypes.h indicates by compiler, copy it to ~/avr in that folder, where pgmspace.h is located.
2. Open up pgmspace.h, find the #include<inttypes.h> sentence.
3. Change it to #incluede<avr/inttypes.h>, done.
Any other environmental error could be solved in the same way I suppose, at least I pass the compilation now.

zhaozhou wu

Hi there.
Did you mean I am supposed to re-install the MinGW several times before the problem I mentioned previously is solved?
Since I'v installed the MinGW already, should I unstall the MinGW first?

zaikun zhang

This method is sucessful for me.
1.Download file:
2.In matlab,Convert current folder that includes the file downloaded in step 1
3.please double click the file to download and install
Note:One time may not be successful, you need to perform the above steps again. please trust youself.
Extra information: Window10+matlab R2018b.

zhaozhou wu

Hi, when I try to use this add-on for my project, the error occurs as the following:
Generated code from your project uses OpenCV and requires that you use a supported C++ compiler.
Anyone know how may I solve this? What kind of C++ complier do I need?

Christopher Buchhaupt

Yunbo Sun

Hi, the question is when will the bug be fixed, since it can support 2016b dealing with compiling issues delacred in Matlab professional descriptions.

Dominik Schmies

JingJing Zhao


Yiyan Ma

the question is what if the computer can not connect the internet? how should i do?

William Rosenthal

Link may be broken. Immediately results in a download error.

William Katzianer


Christopher French


Fabian Querbach

Does not work...


Thanks @Rob de Bijl it works

tao hu


peter siter

No problems with installation.

V: r2018a

Buse Ebrem Bilgin

There is a problem downloading the package.
V: r2018b

Rob de Bijl

I was finally able to install (through a workaround):
Here’s what I did:

1) Go to
2) Copied the download link to a firefox browser window
3) Installed from there without a problem.

Maybe it works for you, too.

Fabricio Toasa

There was a problem downloading the support package.

I have matlab r2018a

Sondre Haug

Nico Zhang


I got the following error not compatible with your version of Matlab or operating system"

-Matlab version : R2018b
- Windows 10 Entreprise
- Intel (R) Core(TM) i5-6300
- os 64 bits, processor x64

Rob de Bijl

I've contacted mathworks Help because of the same problem: "Unable to install on R2018b", because "not compatible with your version of Matlab or operating system".
- R2018b
- Windows 7 enterprise Sp1 (64 bit)
- Intel i7-6600U, 16GB RAM

Sibin Dai

The same issue here, unable to download nor install on R2018a.

Henning Wilhelm

not able to install on R2018b: The support package is not compatible with your version of MATLAB or operating system


@Roselle Grant Learn more about other compilers supported by MathWorks Products at:

Roselle Grant

Which compiler should I use for R2019b?


Andreas Stanicki

Download failed with R2019b


@Lucian Gheorghe, @Rik, @Joseph Mauricio Gutierrez Valero: We fixed the download issue for all releases.

Please note that for R2017a and earlier versions, you must follow the instructions given in the bug report referenced in the Editor's Note.

Lucian Gheorghe

I can't download this software at all. The version I used is R2017b, Windows10.


It seems this submission is not updated yet for use with R2019b, although I admit it is still early day. However, the error message points to a deleted question.

Ping Fung

Thanks Worawat Nakawiro for posting the link and Marko Järvenpää for sharing experience. I also followed instructions by Worawat Nakawiro (installed 5.3.0 on Win10 64-bit PC with MATLAB 2019a) and it worked finally.


thank you! very good service!

Jayashree Bannatti

I have installed Matlab 2017b. And successfully installed minGW 5.3. But when I try to do mex -setup, MATLAB is not showing me MinGW in compiler list even though it is installed.

Yihan Ma


Chong Liu


HIgh Tech Man

Rafi Kandli

cant run mbuild in cmd (windows) . (minGW is installled on matlab and on windows) .i get this error

No supported compiler was found. You can install the freely available MinGW-w64 C/C++ compiler; visit For more options, visit

Marko Järvenpää

okay, got it working with manual installation using the instructions by Worawat Nakawiro. (I am using Win10 64-bit and MATLAB 2019a).

Marko Järvenpää

Installation went fine and everything should be set up but testing with 'mex yprime.c' gives error
Error using mex
The command 'C:\ProgramData\MATLAB\SupportPackages\R2019a\3P.instrset\mingw_w64.instrset\bin\gcc' exited with
a return value '0'

Felix Tiede

Powerfull compiler and most importantly easy to install within MATLAB


I think it deserve learning.

li wang




Yu-Liang Chen

Fawad Ahmad

>> mex -setup
Error using mex
No supported compiler was found. You can install the freely available MinGW-w64 C/C++ compiler; see Install MinGW-w64
Compiler. For more options, visit
how i fix this problem. how i check result of mex

i use matla R2018b in windows 10.

Rob Stark


Davide Brambilla

Victor Dos Santos

Installation is not userfriendly even in Matlab 2017b. I can't deal with this error: "Failed to download the third-party software: MinGW 5.3.0 from". What shout I do ?


Eduard Bohlender

If download is not possible via Add On Manager just download via Browser
change the Working directory to the Download Folder and start the .mlpkginstall from here , works like a charm!

Paul Maurer

Allows compiling of mex functions on Windows


I followed Matlab's suggestions and it did not work. In my MAtlab 2016a following Worakat Nakawiro's link below solved my problem. I strongly recommend people with my Matlab version to do the same.

wxi cao

It's why ???I wanna

dong Guo

Jinlong Mei

Mike Collins

Guodong Hu

Worawat Nakawiro

For those who failed the add-on installation, you can try the instruction given by In my 2016a, these steps worked.

Jason Fohr

Travis Meyer

Download won't start, just a white box

Tanner Litwin


1, Change your current folder to the folder that has mingw.mlpkginstall;
2, double click that file.

He Yan


Art Kotz

I tried running the add-on and it didn't complete. I saw Kshitij's instructions in the comments and did them and it the add-on process went just fine. Removing the environment variables mentioned by Kshitij after installation was necessary on my system (I got and error when building a stand along app that went away when I removed them).

On a second machine where I wanted MinGW64 for other things, I found on another thread that I could install mingw-w64 from (version 6.3), then assign the environment variable MW_MINGW64_LOC to my selected mingw path (one level above the \bin subdirectory). The installation directory must NOT be the default in this case - it must NOT contain spaces. (as an example, I installed to C:\mingw and then set MW_MINGW64_LOC to C:\mingw\mingw64). That seems to be working great too after I ran mex -setup from inside Matlab.

Michael Breuer

Installation is a nightmare. At some days for some releases it works, but most of the time it drives you crazy. Now I consider to stop using Matlab at all. overprized crap.

June Kwon


Brent Fallin

I followed Kshitij's instructions as a precaution and installation went without a hitch on a fresh install of Matlab 2019a.

Kshitij Mall

I am using MATLAB 2019a on Windows 10 system with 64 bits. Initially, I was unable to install it. Mathworks support team helped me out. All I needed was to add two more systems variable using the following process.
Below are instructions for setting environment variables for various platforms.
== Windows ==
Open the* Environment Variables* dialog by following these two steps:
1) From Start *-> *Run, execute the following CPL command "sysdm.cpl", this will open the System Properties dialog
2) Click on the Advanced tab, click on the "Environment Variables..." button, this will open the Environment Variables dialog

Once in the Environment variable menu please use the steps below to set both system environment variables:

Under System Variables, select New.
Set the first variable name "JAVA_TOOL_OPTIONS" with the value of "" (enter these without the quotation marks)
select New again.
Set the second variable name "JAVA_OPTIONS" with the value of "" (enter these without the quotation marks) and click on OK
Click OK again on the previous screen and try the installer again.
NOTE: Once the installation is complete you can remove these environment variables.





Jose Espinosa

3rd party download error for R2019a

Gregor Sanzen

Installation fails with R2019a

Michael Proff

3rd party download error -> Link is blocked by firewall so not tunneled anymore via This is not the case for R2018b where it works fine

MinGW63 download link:

Installation instruction for other version of MinGW63, works also for the 6.3

Sadiq Akbar


Changwoo Lee

3rd party download error.

Thien Thu Ngo

It poped up a blank window

mingliang wang

3rt party download error


Masakazu Ikeda

2017b 3rt party download error
2018b worked

Jackson William

When I download, it isn't useful.

chen wenbo

download error!

enlu wang

I wonder how to figure boost library in MinGw. where is the file location.

Christoph Hindriksen

I use Matlab 2018b, but by trying to download / open it with, I get following failure:

"Failed to load URL with error ERR_TUNNEL_CONNECTION_FAILED (-111)."

Does anyone know the root cause ?

Xiaolong Lai

Can't download

Al Li

Yuhang Qi

@Nimal Have you solve this problem? I am also using R2015a

Hadenge protien

Nice job,loading,open the file location,it's work

Stijn Leenen


I am using r2015a and despite following the bug-report steps, I am unable to install the compiler. The error says "MinGW-w64 a C/C++ compiler from TDM-GCC is not available for this release of MATLAB". Is there a solution? Can anyone help?

Hans Schlenker

Cuong Ngo

Worked on Matlab 2018b, Win 10 x64.

Kai Siang Ke

hu meng

k l


William Thomer

How do I install mingw.mlpkginstall thru SCCM?

Lukas Lamplmayr

Brian Grewe

gan liu


Jingli Xie

下载第三方软件时出现问题。 2017a 和2017b都不行

Adrian Zaragoza

peter adolph


David Franco

"There was a problem downloading the support package"

Kaixiang Wang

William Sanchez

Thanks! @Patrick Hew. MATLAB R2017a on Windows 7

Jerry Seinfel

You may need some magic method(e.g. VPN) to download the 3-rd lib.

Christopher Lum

Works great although I had to implement the workaround as described above to install this on my slightly older version of Matlab. In case it helps anyone, I made a video documenting the installation (and workaround) to install at

leu ryan

does matlab 2018 support Mingw fortran?

kyriacos yiannacou

worst 'support package ' From MATLAB, i need this mingw-64 for several applications but it brings only headache and more headache. i have the 2017b version which 'does not have any issues ' with this package but guess what !! it gives errors at the last installation step. matlab answers are just funny as this package

xiaokui wang

按照2018b在线安装 MinGW-w64 总是失败,卡在第三方包下载。直接 下载,虽然很慢,但能成功,安装后几乎不需要设置就能被2018b识别



Sinwoo Jeong

Pritam Sarkar

lidiya john

Paul Maurer

Allows compilation of mex files under windows.

jianxiong qi

我直接在c、c++模板里编写文件然后生成mex文件,出现的都是无法解析外部命令啊,file.mexw64 fatal error LINK1120,要怎么处理啊,前辈,师傅们,求教啊,小弟感激不尽


<b>Thank you!</b>

Kane Yang

MATLAB R2018a.After i downloaded it, when i double clipped on the "install_supportsoftware.exe",then occuered the window saying "error occurred while starting matlab".


MathWorks' solution for C compilers in the newer versions is pretty much garbage when operating from a secure corporate IT environment. The add-on installer doesn't work at all because it gets hung up on the corporate firewall, and I can't access the basic download files for MinGW from the links you provide because they all wind up at Sourceforge, which is blocked by corporate web filters because it's a freeware site.

Seems like the least you could do for all we pay for MATLAB licenses is host the executables on your own site...

yongliang zhang

Rodney Itiki

Wenzel Salzmann

Yu Zhao

Ke Zhang

Okan Ersoy

leo ye

shutdown your firewall then open this page

xiangrui zhang

Kym Gois

Thank you Saeed Tahvili and Hasan Sari. I did what you said and it worked on R2016a windows 10



Pallavi Prabhu

I am facing problem in downloading setup file, I have R2018a. Below error message I am getting. Can someone help me with this.
Error meesage: This support package is currently unable to download third-party software for MATLAB R2017a and earlier versions. For details and workaround, see this Bug Report.

Ruben Portillo


Kashyap Maheshwari

For the guys who encounter 'Received fatal error: protocol version' error, there is a method to fix this problem. Just follow the instructions mentioned in the below link, and your problem will be solved. I too was facing the same error, but it was solved easily.



For people interested, i have built Boost boost_1_67_0 with this MinGW compiler. The shared zip it is at location :


I have problem installing on R2018a. It does not work.

I got the following error, no success to apply the provided suggestions.

"Download Error
Failed to download the third-party software:
MinGW 5.3.0 from
This is required by:
MATLAB Support for MinGW-w64 C/C++ Compiler
To resolve this issue, see this MATLAB Answer."

Janaka Elangage

Thanks Pawan Singh, it worked. However, I am getting following warning with my Matlab 2017b:
Is there an updated version of MinGW in this link?


" Warning: You are using an unsupported version of MinGW Compiler. To install the supported version of MinGW compiler, see: Install MinGW-w64 Compiler.
For a list of currently supported compilers visit "

Yidao Hu


Why I can not download it!!!

@mohammed alnakhli: You can verify the supported compiler options on this documentation page: The free compiler option for Mac is XCode. MinGW is related to Windows only.

mohammed alnakhli

is it needed it for Mac or only windows?

@JonasDalke: It appears you are using R2016b MATLAB. Have you applied the patch this bug report? You should install this patch first and then try reinstalling the Add-On. If that still doesn't work, please contact Technical Support.


The workaround described in the bug report didn't work, but hasan sari's solution did. Thanks!
Win7, x64, R2016b

@Ammar Ali: MinGW doesn't currently support Fortran. See link above.

@FabianJ: This issue seems more related to general MATLAB and not compiler installation. Please contact Technical Support and they can help you.


Test with 2018a:
Compilation of libsvm succeeded, but function call of 'svmpredict' leads to complete crash of Matlab. Same procedure works for 2017b.

Ammar Ali

Ammar Ali

This does not seem to be working for my FORTRAN code. No compiler has been recognised and I cannot even do the "timestwo.F" example. Works fine for C and C++

Marcus Juniper

Rina-Mari Weideman

@L'Yvonnet This could be related to a few issues when compiling an Excel Add-In including MATLAB version, compiler version, etc. We recommend you contact Technical Support directly as they will be able to better assist you with this issue.

Arindam Mohanta


L'Yvonnet Baptiste

Hi, I performed the exact same procedure as described by pawan, but still gets a "No supported compiler or SDK was found. You can install the freely available MinGW-w64 C/C++ compiler" when trying to compile an excel add in ... any ideas ?

Mirco Steiert

Thank you pawan! It worked for me too!
After the installation just type
setenv('MW_MINGW64_LOC', 'C: \ TDM-GCC-64')
and the second one is
mex -setup
and it works!

Ferdin Joe

Thank you pawan! Your procedure works!

John Wincn

pawan's process works, on x64 Win7 setup

pawan singh

Hi everyone,
I have successfully installed the mingw 5.0 with respect to the given matlab recommendations.
Just download and install to the "C:\TDM-GCC-64" folder
2) In matlab call the setenv('MW_MINGW64_LOC','C:\TDM-GCC-64')
3) In matlab call the mex -setup

Jingchang Liu

Titas Bucelis

"Download Error: There was a problem downloading the third-party software. To resolve this issue, contact Technical Support"


Thank you so much the problem of this message "Download Error: There was a problem downloading the third-party software. To resolve this issue, contact Technical Support" is solved with me by using the Bug Report. My Matlab version is R2016b

George Liu

Huaiyi Wang

As is complained by others, "Undefined variable "mex_spkg" or class "mex_spkg.getEnvVarName"."

Bernt Nilsson

I have managed to build and run a mixed C/FORTRAN mex project with this add-on (using R2018a). The mex-gateway is written in C, but when I try to build a FORTRAN-only project, like the supplied trivial timestwo.F, it does not work. It has been stated in the comments below (18 July 2017) that gnu fortran is supported, but it seems it isn't.

Will there be support for FORTRAN-only mex-files using the gfortran compiler in the MinGW-w64 Add-On?

Pan Merak

sorry, unimplemented: 64-bit mode not compiled in


@Wassili Per your message, have you tried the steps in the Bug Report link shown above in the Edtior's Note? If that doesn't work for you, please contact Technical Support.

Wassili Leibel

Jonas Svedberg

There seems to be some issue with the install package mlpginstall an two-step authentication.
Only when I turned off two step authentication, the 2017b install with mingw5.3 progerssed and worked as expected:
BR Jonas

Nicole Montano Rios

Thank you very much @hasan sari, your instructions worked perfectly.
hasan sari
26 Apr 2017
Hi everyone,
I have successfully installed the mingw 4.9.2 with respect to the given matlab recommendations.
Just download and install to the "C:\TDM-GCC-64" folder
3) In matlab call the setenv('MW_MINGW64_LOC','C:\TDM-GCC-64')
4) In matlab call the mex -setup

Saleh Mirheidari

Is there any way to install this compiler outside MATLAB (not with the Add On) and configure it to Mex command?

Tobias Stalfors

Running 2017b not possible to download

Magnus Carlsen

Patrick Hew's 26 Mar 2018 response provides a concise walk-through, at least for me. I have MATLAB R2017a on Windows 7.

Nicolas Hueber

@sondes belgacem, @Jimmy Bouche: It looks like you have installed the 3rd party LIBSVM library successfully but not the compiler. Please follow the steps here: and then try the installation of the support package.

@Liza Belova: It looks like you are seeing this error due to Java. Please follow the steps in that same link ( and then try the installation of the support package.

Liza Belova

Does't works on MATLAB R2015b
The following errors occur:
1) Download Failed: Received fatal alert: protocol_version
2) Support Package Installer is in the middle of a download operator. Please wait until the operation is finished or cancel it and try again.

Supplied the required version tdm64-gcc-4.9.2 for Matlab 2015b

Why does't it work?

Anil Yildiz

Giordano Baldeschi (14 Mar 2018) 's solution works. Otherwise, it does not install. My version is R2016b.

Ângelo Paulino

Does not works on MATLAB R2018a.

Majoris VY Canis

Ankit Mondal

I followed the instructions given in the Bug Report at the top of this page, and it worked.

Ingo Ruthenberg


I try to use
mex -v -L"c:\ProgramData\MATLAB\SupportPackages\R2018a_1\3P.instrset\mingw_w64.instrset\x86_64-w64-mingw32\lib" -liphlpapi MACAddress_mex.c

And i get the error:
Error using mex
MEX cannot find library 'iphlpapi' specified with the -l option.
MEX looks for a file with one of the names:
Please specify the path to this library with the -L option.

I looked for libiphlpapi.a but i found it has the extension .a and not .lib as it searches by default . Any way to fix this ?
Works with Visual Studio 2017 compiler.

Patrick Hew

@Brian Kirby, @Saeed Tahvili, @hasan sari and Mathworks Support: thank you, those instructions worked. R2016a, Windows 10.

1) manually download and unzip MinGW-w64 from MathWorks github page into a new folder C:\TDM-GCC-64
2) follow help from MathWorks support team to manually configure MinGW for Matlab



Douglas Cameron

seriously. codegen says that it needs this to compile with parfor. and, i am simply unable to get the work around to work. I guess i will spend the next three hours installing matlab 2017b or 2018a.


@MathWorks Supported Compilers Team:
No, it does not work on R2018a. I had the same issue in R2017b and I had to download the add-on on a PC that is outside of the network using the ssi_standalone.exe (because of a certificate issue).
Now in R2018a, this method does not work because ssi_standalone.exe does not exist anymore.

You need to fix this issue...

@AnnArborObserver, yes it works for 2018a. Description is correct
MATLAB R2017b and beyond: MinGW GCC 5.3 from


Does this add on work for Matlab 2018a? Please update the description.

Manish Thorat

Is gfortran supported?

Giordano Baldeschi

My version is matlab 2016a in Windows10.
I followed the Mathworks instructions, here

1) download one of the packeage at the end of the page ( for MAC, WIN, LINUX).

2) watch inside the .zip file and find the same files in the MATLAB folders, these file in the Matlab folders must be saved for safety in another folder, after that you have to replace them inside the .zip files.

3) Come back in Matlab program and download MinGW from Add-Ons, next restart Matlab and you have finish.

I hope to be clear and I hope to have helped you.

Daniel Fernandez

Dear MathWorks support:

How could we use the software with prior versions to R2017a?


Please see editors note: This support package is currently unable to download third-party software for MATLAB R2017a and earlier versions. For details and workaround, see this Bug Report


Keep having the error Download Error Received fatal alert: protocol_version


Totally a trash. Keep having the error Download Error Received fatal alert: protocol_version

Willi Gottstein

Zhida DENG

Hi everyone,

It has been successfully installed in MATLAB 2017b. In the beginning, I was failed to download the MinGW GCC 5.3 as third-party software for MATLAB R2017b, this was solved when I close the MATLAB. Try it, hope it would help.



Boris Godoy

chengjun tan

Thank you Saeed Tahvili and Hasan Sari. I did what you said and it worked \o/

Saeed Tahvili

I tried the instruction of "hasan sari" and it worked.
hasan sari
26 Apr 2017
Hi everyone,
I have successfully installed the mingw 4.9.2 with respect to the given matlab recommendations.
Just download and install to the "C:\TDM-GCC-64" folder
3) In matlab call the setenv('MW_MINGW64_LOC','C:\TDM-GCC-64')
4) In matlab call the mex -setup

Brian Kirby

Hi, I was able to work around the download error that many seem to have had. I have Matlab R2016a.
'Download Error Received fatal alert: protocol_version'

1) manually download and unzip MinGW-w64 from MathWorks github page into a new folder C:\TDM-GCC-64
2) follow help from MathWorks support team to manually configure MinGW for Matlab


We are working on the following download error and will update when it is fixed.
Download Error Received fatal alert: protocol_version

yuji Ito

Fail to download with fatal error. I'm use Matlab R2015b

Nick Yap



Rafael Gomez- Sjoberg

Samuel Giatti

Christof Bernhard

I run into problems during downloading/ installing too. I managed to solve it by setting proper proxy settings under Home -> Preference -> Web : "enter your proxy settings"
Problem faced and solved in a company network with a Win 10 machine and Matlab 2017b.

Ronald LaFleur

After logging into my MATLAB account, I installed the compiler according to the 'Download button at the top of this page. The installation seems straight forward and appeared to be a successful install as it progressed through the completion bullets and had no errors reported.

To check it, I used the page
and the MATLAB command window reported :

>> mex yprime.c
Building with 'MinGW64 Compiler (C)'.
MEX completed successfully.

This created a file with FileName yprime and FileExtension MEXW64 . This runs successfully as a function from the command line

>> yprime(1,1:4)

ans =

2.000000000000000 8.968491817397247 4.000000000000000 -1.094723275660229

All seems well. HOWEVER, now when I attempt to create a complied library (using APPS tab and the Library Compiler in the APPLICATION DEPLOYMENT group ) I get a failure with a log file that reports the compiler was not found.

I haven't been able to figure this out. It seems to me I am missing something or, the support team needs to point to a step-by-step procedure (with verifications) to allow the installed compiler to be accessed by the application deployment tool. I have a valid license and valid installation of MATLAB R2017a.

Brett Donnellan

Hung Nguyen

Marco Riani

In my case (windows 10 and MATLAB 2017b) it was necessary to run MATLAB as administrator in order to successfully install MInGW compiler.

Vincent Carmona

Following matlab 2017b warning that I am using an old version of MinGW compiler I download the mingw.mlpkginstall file. The installation process is stopped with a download error:
Failed to download the third-party software:
MinGW 5.3.0 from

This is required by:
MATLAB Support for MinGW-w64 C/C++ Compiler

Hongshuai Chen

Hongshuai Chen

jack carter

Youssef Jaber

Fails to download every time. This has been an issue for months

song li

Ali Nawaz


Worked perfectly

Why so many people give 1 star ? They have hacked Matlab version , full of viruses and malware , of course it wont work properly
I have Home edition . Worked perfectly and tested


Building with 'MinGW64 Compiler (C)'.
C:\ProgramData\MATLAB\SupportPackages\R2017b\3P.instrset\mingw_w64.instrset\bin\gcc -c -DUSE_MEX_CMD -m64 -DMATLAB_MEX_FILE -I"C:\Program Files\MATLAB\R2017b/extern/include" -I"C:\Program Files\MATLAB\R2017b/simulink/include" -I"C:\Program Files\MATLAB\R2017b/extern\lib\win64\mingw64" -fexceptions -fno-omit-frame-pointer -O -DNDEBUG "C:\Users\timo\Documents\MATLAB\MACAddress_mex.c" -o C:\Users\timo\AppData\Local\Temp\mex_593534422989106_7140\MACAddress_mex.obj
C:\ProgramData\MATLAB\SupportPackages\R2017b\3P.instrset\mingw_w64.instrset\bin\gcc -c -DUSE_MEX_CMD -m64 -DMATLAB_MEX_FILE -I"C:\Program Files\MATLAB\R2017b/extern/include" -I"C:\Program Files\MATLAB\R2017b/simulink/include" -I"C:\Program Files\MATLAB\R2017b/extern\lib\win64\mingw64" -fexceptions -fno-omit-frame-pointer -O -DNDEBUG "C:\Program Files\MATLAB\R2017b\extern\version\c_mexapi_version.c" -o C:\Users\timo\AppData\Local\Temp\mex_593534422989106_7140\c_mexapi_version.obj
C:\ProgramData\MATLAB\SupportPackages\R2017b\3P.instrset\mingw_w64.instrset\bin\gcc -m64 -Wl,--no-undefined -shared -static -s -Wl,"C:\Program Files\MATLAB\R2017b/extern/lib/win64/mingw64/exportsmexfileversion.def" C:\Users\timo\AppData\Local\Temp\mex_593534422989106_7140\MACAddress_mex.obj C:\Users\timo\AppData\Local\Temp\mex_593534422989106_7140\c_mexapi_version.obj -liphlpapi -L"C:\Program Files\MATLAB\R2017b\extern\lib\win64\mingw64" -llibmx -llibmex -llibmat -lm -llibmwlapack -llibmwblas -o MACAddress_mex.mexw64
MEX completed successfully.

Judas Chu

xin tang

pure trash

Arturo Portugal

No problems during installation. Let's see how it works.


Jet Simpson

wen is right.
Go to the following link and click 'download mingw now'. Save the .mlpkginstall file.
Then run it.

Jeonggyu Bak

Chanawee Chavaltadaq

Andreas J.

Vaidas Ma



How to install it? I still got the problem as below.

No supported SDK or compiler was found on this computer.
For a list of supported compilers, see

andres moreno

before finishing the installation, I get this warning "MinGw compiler not setup for use with MEX setx does not recognize as an internal or external command" and matlab tells me that "No supported compiler or SDK was found." How is the correct way to install it then? I have windows8.1 of 64bits and matlab R2017b, please help me!

Chen Qian

use the sentence in the command window
>> uiopen( '....', 1)
'...' is the path of your mingw.mlpkginstall file

[learned from the Internet]
Good luck!

Sean Bai

Now,it worked perfectly!

Cannot Install. Please help.

Received error said: Error using open (line 162) Only three part message catalog IDs are suppported by hwconnectinstaller.intermal/getAdjustedMessageID

Kazuhiro Umezawa

can not install


Installation Steps (English):
1.Execute matlab and change the path to the folder which contains mingw.mlpkginstall;
2.Double click the mingw.mlpkginstall in the current folder. Then follow the instructinons and the compiler will be installed.

安装步骤 (Chinese):

Alexander Lampe


Hi, I want to ask how to install it ?

Safer Mourad

it worked fine in my case with Windows 10. I've used Matlab's Add-On Explorer for installation and invoked the matlab command "mex -setup" afterwards...
Good Luck

Alexandra Kerl

Somehow downloading and installing it in Matlab 2017b didn't work for me, but it did in Matlab 2016b and is now also available in Matlab 2017b.


Downloaded mingw.mlpkginstall file.
Ran it but it keeps on installing for hours and hours, without completion! (internet connection is fine)
Can someone please suggest what to do?

Gang XU

can not install

Xiao Fu

too bad
应用程序无法连接到 MathWorks。有关解决此问题的详细信息,请参阅此 支持文章。

yuyang gao

shiyong zhang

Qiang Gu

Pankaj Kumar Behera

while trying to install?download MinGW for Matlab R2017a i am facing trouble ie; support package is succesfully downloaded but third party software fails to download everytime.please give me a solution.Do i need a licensed version of matlab or not?
because i have a ccracked version of matlab R2017a???

Andreas J.



I tried to install on R2017a, At the end of the installation, there is compiler setup failed message: MinGW compiler directory not found. Unable to setup the MinGW compiler with MEX.
Please advise. Thank you.

Wei-Jie Chen

errors about install this addone package:

can not download:
MinGW 5.3.0 from

2017b. how can I deal with this problem.
Any one know? thanks!

Wei-Jie Chen

Hamidreza Mirtaheri

qilin guo

有网络连接的情况下,我在在试图安装 MinGW-w64 是总是收到这个错误提示:下载支持包时出现问题。要解决此问题,请参阅该 MATLAB 答复,但是参考链接没有给出合适的解决方法。我确信我的网络链接没有问题。我猜测是 MinGW-w64 的网站可能出现了问题。希望尽快解决。

Su Lim Kok

It kept Download failed, read time out, no matter how much i watch it, still failed....
i tried 6 times... MATLAB 2015b

HD wang

Rocco DePietro

No bueno for 2017a and 2017b :(

babita verma

it does not installs!!

It does not work. I keep getting the "No supported compiler or SDK was found." message.

sukekshani dome

I am trying to install it but it failed showing following error, "PKIX path building failed , Unable to find valid certification path for requested target" I am using windows 10 and matlab 2016a.

Joris Mens

Bernt Nilsson

18 Jul 2017 (see below) it was reported that GNU FORTRAN is supported using this package. I have installed the package and C-files compile fine, but how do I compile FORTRAN files?

Syed Qaseem Ali

I installed it and for starters it succesfully compiled my c function. No problems so far.


Yongqin Zhang

Taylor Fryett

Does not work. Toolbox installation always reported an error. Matlab does not even correctly detect compatible MinGW installations by itself, it simply tries looking for an environment variable and then gives up. Could at least give the option to search a directory for a viable MinGW installation as Jetbrains does with their IDEs.

Hamid hassanpour

Thanks a alot, working without anu issue

Paolo Binetti

It worked perfectly

Stanimira Georgieva

sorry but I think "download issues" for Matlab2015b have not been resolved, unfortunately!

Stanimira Georgieva

Intallation keeps failing; no information given why..

Craig Fletcher

Fell over at creating a directory the first run, but appeared to be smart enough to understand it had done all the downloading for the second run that it didn't waste time re-downloading. The second run was successful.


I'm trying to install MATLAB Support for MinGW-w64 C/C++ Compiler on my PC and I can not open it on Matlab 2015b.
Can anyone help me to show me the procedure for installation, because I am a beginner and I do not really know Matlab

Thank you for your help


javier gismero

@hasan sari - Thanks. That worked for me (on 2017a under W10).


how to use it?

found it :) thanks

I want to uninstall MinGw, how can i do that?


JessonCalsper CHENG


MinGW-w64 a C/C++ compiler from TDM-GCC is not available for this release of MATLAB
I have MATLAB R2014b


It does not work for me. I am running MATLAB 2017a on a pc with 64bit-windows 10. When I try to compile the c files. It output the following error:

undefined reference to `__imp_WSAGetLastError'
undefined reference to `__imp_inet_addr'
undefined reference to `__imp_gethostbyname'
undefined reference to `__imp_htons'
undefined reference to `__imp_sendto'
undefined reference to `__imp_send'
undefined reference to `__imp_WSAGetLastError'
undefined reference to `__imp_closesocket'
undefined reference to `__imp_WSACleanup'
undefined reference to `__imp_recvfrom'
undefined reference to `__imp_recv'
undefined reference to `__imp_ntohs'
undefined reference to `__imp_htons'
undefined reference to `__imp_WSAGetLastError'
undefined reference to `__imp_socket'
undefined reference to `__imp_connect'
undefined reference to `__imp_ioctlsocket'
undefined reference to `__imp_socket'
undefined reference to `__imp_socket'
undefined reference to `__imp_htons'
undefined reference to `__imp_setsockopt'
undefined reference to `__imp_bind'
undefined reference to `__imp_closesocket'
undefined reference to `__imp_listen'
undefined reference to `__imp_ioctlsocket'
undefined reference to `__imp_accept'
undefined reference to `__imp_ioctlsocket'
undefined reference to `__imp_setsockopt'
undefined reference to `__imp_connect'
undefined reference to `__imp_ioctlsocket'
undefined reference to `__imp_WSAStartup'
undefined reference to `__imp_ntohs'
collect2.exe: error: ld returned 1 exit status

Ji Tan

followed the steps to install to C:\TDM-GCC-64, still not working....


Bernt Nilsson

I should have been more specific, I meant GNU FORTRAN of TDM MinGW package for 64-bit Windows. Do you mean this is supported? This is not clear to me from the Supported Compilers page, where it says only C/C++ for MinGW.

@Fake: The MinGW support package has been recently updated in MATLAB to resolve previous download issues. Please try reinstalling MinGW through the support package in MATLAB. If you are having continued issues installing through the support package, please contact MathWorks Technical Support.

@Bernt: GNU Fortran is currently supported in MATLAB (v4.9 for R2017a):

Fake McFaker

I installed mingw w64 in Matlab r2015b. The path that mingw is saved is C:\TDM-GCC-64. After the installation I opened Matlab and i used this command setenv('MW_MINGW64_LOC','C:\TDM-GCC-64') and after this i pressed -mex filename.c- and i had this error
"Error using mex
No supported compiler or SDK was found. You can install the freely available MinGW-w64 C/C++ compiler; see
Install MinGW-w64 Compiler. For more options, see"
I can't figure out why this is happening. My professor does exactly the same things and his matlab works fine when he uses the compiler. Please help me! Thank you!

Bernt Nilsson

Are there any news about support for GNU FORTRAN?

Tuong Nguyen

Richard Crozier

I figured out you can just change the lib name to end '.lib' instead of '.a'. This shouldn't work since a .a file is a different structure from a .lib file, but apparently mingw-w64 is smart enough to notice the file format.

@Richard: I looked at your MATLAB Answers page and I can't discern from that warning message which LIB function it refers to, the .a or the .lib file. Please check the -l and -L usage, along with the filenames command and the complete path formatting, here: If you are still stuck with this usage, please contact Technical Support.

Richard Crozier

I have the same issue as Xi Cai below. I want to link to a .a file, also produced by Mingw-w64, but mex only passes .lib file names to gcc. I attempted to link to a .a file by using the full path, as suggested by the compilers team, but this results in an error:

"$$LIB not found; check that you are in the correct current folder, and check the spelling of '$$LIB'.

See my MATLAB Answers question here: I'm using R2016b. Is there any solution, or am I doing something wrong in my command?

Joshua Forer

Also getting the 'INSTR_SET_DATA_DISPLAY_NAME' error; using R2016a


When I try to install this I get the following error:

There was an error installing third-party software for Support Package mingw:
does not contain archives for third-party software used by the support package.

I followed the instructions in the bug report that John posted (, unfortunatly it didn't work. This is probably due to the fact that I use R2016A and not R2016B. Does anybody know a way to install this add-on in another way?

Youssef Alami mejjati

Can you guys do something that work for once.

Felix Schmachtenberg

Hey i work with Matlab R2016a and had also the problems with the error: There was a problem installing the third-party software. To resolve this issue, contact Technical Support. I tried to solve the problem the way wich is showen if you follow the Link from John, 21 Jun 2017.
Now i have the error: 'INSTR_SET_DATA_DISPLAY_NAME'.
Did one of you haven a idea to fix that error?

Li Wang

For people working with Matlab 2017a, please see the fixing method of @hasan sari below.



I experienced the error pointed out before (i.e. `There was a problem installing the third-party software. To resolve this issue, contact Technical Support`). I`m using R2016b. I followed the recommendation from the link below as suggested by MathWorks Supported Compilers Team and it works now! Thank you.

Jacob Palczynski

wang zhen

really sucks

Thuong Nguyen

I stumbled on this error while trying to install the compiler: INSTR_SET_DATA_DISPLAY_NAME. Please could anyone give advice on the solution to this problem?


It dosen't work with NI's
32bit program.

Maruti B Patil

Matlab sucks

Nikhil Kale

@Hasan sari, works for 2017, thanks

The name of the library you are looking for is “libiphlpapi.a” and it is located in the directory “$mingwroot\ x86_64-w64-mingw32\lib” for MinGW 4.9.2, where $mingwroot is your installation directory of the compiler. Since this library has a ".a" extension, it is a static library and you would need to provide the full path to the library in your MEX command. This would look something like:
mex <filename>.(c/cpp) $mingwroot\ x86_64-w64-mingw32\lib\ libiphlpapi.a.

Hope this helps

Xi Cai

I am using Matlab 2017a, and I have installed the MinGW successfully. But I have an error as below:
"MEX cannot find library 'Iphlpapi' specified with the -l option.
MEX looks for a file with one of the names:
Please specify the path to this library with the -L option."

Doesn't MinGW have the iphlpapi.lib? Any idea to solve this problem? Thanks a lot.

Jack Foster


I have discovered that MinGW is not compatible with MATLAB R2015a.

Instead I was able to use SDK 7.1 on windows 10.

To help others do this, If you install SDK 7.1 from this link:

and still have problems, such as typing into MATLAB

mex -setup

and then receiving the error:

No supported SDK or compiler was found on this computer.
For a list of supported compilers, see

This means that you need to follow the instructions on this page:

This worked for me with Windows 10 MATLAB 2015a.


same problem like Nassim Hassaim when i run "make" it turns out
Error: D:\Program Files\MATLAB\R2016a\toolbox\libsvm-3.22\matlab\make.m failed (line 13)
gcc: error: \-fexceptions: No such file or directory

need help :(


I am using
MATLAB R2015a (
64-bit (win46)
Windows 10

I have completed steps 1) to 3) in hasan sari's post, however step 4 gives me the error in the command window:

Error using mex
No supported compiler or SDK was found. For options, visit

Thank you.


Error, Archive is not a zip file.

Daniel Byberg

Emanuel Silva

@hasan hari Thank you ! This worked flawlessly on 2017a.

Steve Barnes

@hasan hari Thank you ! It worked for me aswell :)

Gustavo Jesus

@hasan sari - Thank you very much! Your steps, following exactly (including dl and installing from sourceforge) worked flawlessly for 2016b.

Gustavo Jesus

Ola Olsson

@hasan sari - Thanks. That worked for me (on 2017a).

hasan sari

Hi everyone,

I have successfully installled the mingw 4.9.2 with respect to the given matlab recommendations.


Just download and install to the "C:\TDM-GCC-64" folder


3) In matlab call the setenv('MW_MINGW64_LOC','C:\TDM-GCC-64')

4) In matlab call the mex -setup

Taotao Zhou

@Antonio - There is a patch that is specifically for these R2016b issues found in this bug report: . Please install the patch found there and if you are still having problems, please don't hesitate to contact technical support.

Antonio Martin

I am experiencing similar issue to Jiong Zhang and Lukas Mannhart.
On Matlab R2016b, the MinGW-w64 packages appear to be successfully installed using the Add-Ons site.
Nevertheless, I still get the following error:
Error using loadlibrary
No supported compiler or SDK was found. You can install the freely available MinGW-w64 C/C++ compiler;
see Install MinGW-w64 Compiler. For more options, visit

Error in loadlibrary

I have tried reinstalling seting UAC to "never notify", but the error persisted.

Is there anything else I could try? Thank you in advance.

@Lukas - This is probably related to UAC configuration on Windows 7. Please try temporarily lowering your UAC settings on Windows 7 via the Control Panel, and then reinstalling the Add-On.

@Jiong – This is likely an issue with your UAC configuration on Windows 7. We have made a change that should resolve this. Please try reinstalling the Add-On. If this doesn’t resolve your issue, please share more details on MATLAB Answers or contact Technical Support.

@Logan – Your issue may be related to the following:
If not, we encourage you to post more details about your problem on Answers or contact Technical Support.

@Shin – We suggest you following the steps in this Answers post:

Jiong Zhang

Logan Sorenson

This problem existed in 2016b and 2017a still has the same issue? Unacceptable. This should have been fixed.

Shin Yu Chen

Hi, I kept getting the message
"There was a problem installing the third-party software. To resolve this issue, contact Technical Support"
How can I fixed this problem?
Thank you


@Shant - Please disregard our last response. Compiler SDK features does not support MinGW 4.9. Please use a supported compiler listed on our website:

@Shant - It could be that you are installing a newer version of MinGW. Check that you are installing MinGW version 4.9 (and haven't selected the box for updates).

Shant Dakessian

I am trying to create and Excel Add-in using Matlab Compiler. I have tried multiple methods of installing MinGW64 Compiler as this was recommended for this purpose. I have tried using the Add-on option in Matlab, downloading the installation files separately and then installing via Matlab (as recommended in the technical support section), and installing the compiler separately and then adding environment variables to connect it to Matlab. In the error log from the compilation it says that the compiler was found, but it still crashes and claims that no supported compiler or SDK was found, and suggests I install MinGW64. Please help fix this issue. Thanks in advance.

I have a problem my matlab says that MinGW-w64 is already installed but when I execute mex-setup it says: "Error using mex
No supported compiler or SDK was found. You can install the freely available MinGW-w64 C/C++ compiler; see Install MinGW-w64 Compiler.
For more options, visit"

Whats the problem?


How to use MATLAB configuring mingw when it is fully installed on my computer? For add-on function would not be helpful, the local network is completely disconnected from the internet.

Wenlong Xu

I want to thank @Samuel Whiteley. I had a problem during the process, but Samuel's way help me out.


Hi @all,

currently I had to reinstall the MinGw64 Compiler again and encountered the same error I encountered during December of last year (2016).

The solution again was to directly download the files mentioned in the FAQ from Sourceforge an placing them manualy in the downloadfolder used by Matlab for thirdParty sotware.

I also write-protected the files to prevent them from beeing overwritten by the installer, since at least one file was change during the execution of the installer.

Please use the following link, to prevent to be directed to a mirror (the links in the FAQ still follow to at least one different file. I tested it several times in a row, and mostly the core zip-file sometimes changes in size (?!?!) ... therefore:

Place these files according to the FAQ ( and render them write-protected (better safe than sorry).

Afterwards run the installer again and hope for the best.
I could reproduce this beahviour several times, therefore I think, there is a bug regarding the mirror-versions delivered by SourceForge.


@Andreas – Have you tried using the Add-Ons installer from within MATLAB? Or have you tried following the instructions in the link in the Important Note above?

@Gharbi – This sounds like a different issue. Suggest you contact MathWorks technical support.

gharbi leith

hello , when i want to install mingw.mlpkginstall An error has appeared
: Failed to load URL https://localhost:31515/ui/install/supportsoftwareclient/supportsoftwareclient/index.html?

plz i need solution

Andreas Viborg

Using Windows, I moved the files to a location without spaces in the pathname and added the location to PATH and created the MW_MINGW64_LOC variable. Now MATLAB locates the compiler using mex -setup.
When I try to compile yprime.c, MATLAB tells me that the include "math.h" is not found.
So what am I missing?

@Rod - Are you using Windows 7? If so, this may be related to your UAC setting. We are currently investigating.


Somehow in R2017b I'm not getting any error during installation, but mex keeps saying that no compiler is available :(

Mohamed Abdinasir

Borja21091 - Thank you very much. You have saved me after hours of headache. It worked after following your instructions.

James Briscoe

I have the same error as Brian McCall, I tried the workaround suggested in the description without luck.

Ze Li

Ze Li


matlab 2015b, help for erreur :
MinGW-w64 succesfful
mex -setup
MEX configured to use 'MinGW64 Compiler (C)' for C language compilation.
Warning: The MATLAB C and Fortran API has changed to support MATLAB
variables with more than 2^32-1 elements. In the near future
you will be required to update your code to utilize the
new API. You can find more information about this at:

To choose a different language, select one from the following:
mex -setup C++
mex -setup FORTRAN
libsvm. + Make ==>

Building with 'MinGW64 Compiler (C)'.
Error: C:\Users\Nassim\Desktop\SVMTRY\matlab\make.m failed (line 13)
gcc: error: \-fexceptions: No such file or directory



roger james

Ziwei Wu

I found a solution for the problem of the failed installation of the third party software.

Just go
and download any of the folders.

After that, install mingw directly and change several environment parameters. There are many tutotial on google. At last, don't forget torestart you computer.

bone Zlase

Why I install it which shows "Error installing third party software MinGW 4.9.2 Core: archive is not a ZIP archive".Please help me ...I need help..

@Alex – We appreciate your feedback. Unfortunately this Add-On installer is currently not working as you noticed. The description has just been updated. We are working toward a solution.

In the meantime, you can use the following workaround instructions to install MinGW for use with MATLAB:


como se descargan

Alex R.

This is broken. Files are not downloaded correctly (it seems redirects are not followed). I notice that this is an old issue which has still not been fixed. Perhaps Mathworks should stop advertising this as an officially working solution and supported compiler.

The zip files contain:

<title>302 Found</title>
<h1>302 Found</h1>
The resource was found at <a href=""></a>;
you should be redirected automatically.


... which clearly shows redirects were not followed and the package is left in a broken state.

Vittorio Cristiano

thanks a lot!


Thank Samuel Whiteley! Your solution works.


Lijo Thomas


@JensHamann I had the same problem and was able to solve it by doing this:

(source ->

If you couldn't install Mingw-w64 using the Add-Ons toolbar of Matlab2016b on Windows, you can use this workaround. Keep this in mind that you need to change the paths according to your installation paths.

- The Mingw-w64 official website redirects you to Win-builds project which is a package manager for a bundle of open source development tools. So, first you need to install the Win-builds.
While installing Win-builds, make sure you are entering a path that does not contain any spaces e.g. C:\Win-builds.

- After installing Win-builds, just hit the Process button to install all packages where Mingw-w64 is among them.

- Now that you installed Mingw-w64, you need to define the MW_MINGW64_LOC environment variable which Matlab uses it to detect Mingw-w64.

- To define the environment variable do the following steps:

Control panel\ System\ Advanced system settings\ Advanced\ Environment Variable\ User variables for $YOUR_USER_NAME\ New

- Put Variable name = MW_MINGW64_LOC and Variable value = C:\Win-builds. Notice that the Win-builds puts all executables in C:\Win-builds\bin and by defining this variable, Matlab will automatically scans the bin folder of the path looking for gcc.exe.

- In Matlab, select MinGW compiler to compile C code by executing this:

mex -setup

- Now that you installed the Mingw-w64 and defined the MW_MINGW64_LOC environment variable, it is time to build and test the yprime example. So Launch Matlab and type the following command (Do not forget to modify the path accordingly):

mex -v 'C:\Program Files\MATLAB\R2016b\extern\examples\mex\yprime.c'

- A successful installation will show the following message:

MEX completed successfully.

- Finally, you can test your installation by typing yprime(1,1:4). The answer would be:

ans = 2.0000 8.9685 4.0000 -1.0947

Jens Hamann

I have tried to install with the guide where the 5 files are replaced, but with bad luck! It say in matlab; Warning: "C:\ProgramData\MATLAB\SupportPackages\R2016b\mex\supportpackages\mingw" not found in path.
> In rmpath (line 66)

Any one who knows what to do? I have unstall whole matlab, add ons and so on but nothing works :(

Mahdi ho

I have a disabled Add-ons in my matlab how can I install the file? is there any other method

Hi, I get this error during the installation process:
mingw compiler directory not found. Unable to setup the mingw compiler with mex
Someone can help?

Aurelien Villemagne


If your error message is
"Error installing third party software MinGW 4.9.2 Core: archive is not a ZIP archive"

Visit this reference page


Helix Hsu

Thank you, GuanTou


If your error message is
"Error installing third party software MinGW 4.9.2 Core: archive is not a ZIP archive"

Step 1 : Open the download folder
For example. My matlab version is R2015b.
I need to open

Step 2 : Check all zip file
If your zip size are all only 1KB, you need to download them manually.
For example. There are 5 zip in my folder which are:
These 5 files with the same filename can be found in following website"

Step 3 : Continue the installation
If you have closed "mingw.mlpkginstall", re-open it and run.

Aliff Zin

can anyone guide me for the installation, once i download the file mingw.mlpkginstall, then what?

Thank you in advance

Felix Dawes

Thank you!


I have solved this problems "There was an error installing third-party software for Support Package mingw: C:\MATLAB\SupportPackages\R2016a\downloads\mingw_download does not contain archives for third-party software used by the support package"
with the information on this page ""

Felix Dawes

Keep getting this error

"There was an error installing third-party software for Support Package mingw:
does not contain archives for third-party software used by the support package.

To continue with support package installation:
Use "Install from Internet"
Use "Download from Internet" to download the complete set of files, and retry installing from folder."

Any advice would be appreciated

Waheeb Yaqub

I had a problem when installing the third party packages. After trying multiple solutions, only Samuel Whiteley worked perfectly. Thank your awesome help Samuel.


I want to thank Samuel Whiteley. I had a problem during the process, but Samuel's way help me out.


Yields the following error:

"There was an error installing third-party software for Support Package mingw:
does not contain archives for third-party software used by the support package.

To continue with support package installation:
Use "Install from Internet"
Use "Download from Internet" to download the complete set of files, and retry installing from folder."

Dyson Freeman

I've got an error: it shows "Error installing third party software MinGW 4.9.2 Core: archive is not a ZIP archive"
Plz give some advices, thanks.

Wenyu Li

Thanks Samuel Whiteley!


During installation i am asked to login into the mathworks account and whenever i try to login, it gives me "An error has occured" message. How can i install this package..?

Peichao Li

Claire Motion

Installation via add-on broken for me on Win7 running 2016a, comes back with 'third party error.' In the end I followed Samuel Whiteley's comment by installing MingGW manually, and configuring in settings. Restarted MatLAB and it worked. Thanks Samuel!

Xavier Silvani

Hello u all,

i try to install the MINGW-W64 package for compiling C programs on W8.1 Pro Microsoft OS platforms from Matlab with mex command.

Each attempt fails at the installation of the third-party software.

Does anybody already fix such a pb?

The package was download from TDM.

I thank you in advance.


Rolfe Power

@MathWorks Supported Compilers Team
I was receiving the same error as Christian, however when I tried the steps outlined in the FAQ (using the unconnected computer) the error switched from "There was a problem installing the third-party software. To resolve this issue, contact Technical Support" to "Something Unexpected Occurred"

xingyu zhang

@Christian – Thanks for the feedback. I encourage you to share your comments on MATLAB Answers.

The links you share should redirect to the same location as the links in the MATLAB Answers FAQ, although sometimes they each direct to different mirror sites. The problem may be with the mirrors and not the links.

Could you try the FAQ links again and let us know if they still don’t work for you?


Again a long story short...
After some troubleshooting, it seems like the java-code behind this support-package seems to run into some problems downloading the necessairy files from Sourceforge.

While the FAQ generally is correct in replacing the files in


the files with which you are supposed to do so are not correct.

The installer itself tries to download the following files:

Please use these, to download the third-party tools from Sourceforge and put them in the aformentioned folder. (Please refer to the FAQ !!!!)

This helped me, I hope this will also fix your problems.

PS.: Hope the support does change the links in the FAQ and can initiate a revision of the support-package java-code.

Link to FAQ:


And somewhat, my previous comment is gone ...

Long story short (this time):
The installer had 'acces denied' problem. And I had to take ownership of the folderstructure containing the support package:

(Windows) <Downloadfolder>\Mathworks\SupportPackages\R2016b\archives\

But afterwards I still remained with the already mentiond error message from my previous post, although all zip files stoped corrupting. At least to what I can see.


Ah, srry I posted the wrong error message:

SSI downloadAndInstallSP Response: {"exception": {"message":"There was a problem installing the third-party software. To resolve this issue, contact Technical Support","title":"Install Error","cause":" archive is not a ZIP archive"}}

@Johannes, @Christian, and @Oskar: The downloaded archive may be incomplete. Please contact Technical Support or see answer #8 in the following MATLAB Answers post:

Johannes Scherle

I'm having the same issue as "Oskar Laudo" and "Christian". The installation of the compiler fails.


I'm having the same issue as "Oskar Laudo", have there been any information on how to probably solve this issue?

@Mandar - Please contact Technical Support for help with this issue. Or see MATLAB Answers and answer #8 in our FAQ:

Mandar Malve

getting a error called ZIPExtension. The file located is not a zip file

We've created an FAQ on MATLAB Answers with answers to some common questions:

Gabriel Theberge

Ok, finally, I did the same as Samuel Whiteley and it works. Thanks you very much!

Gabriel Theberge

Hi. I was able to download package but received the following error during install:

"There was an error installing third-party software for Support Package mingw:
does not contain archives for third-party software used by the support package.

To continue with support package installation:
Use "Install from Internet"
Use "Download from Internet" to download the complete set of files, and retry installing from folder."

Any support will be appreciated. Thanks.


tannaz akbarpour

thanks for your suggestions.I installed the compiler and it was ok. now I face another error. when running make.m I get the following error: "error: \-fexceptions: No such file or directory" . but the file exists in directory!!!!

Jiaying You

Installation completed.Thx

Jiaying You

Jiaying You

An error occurred after installing first 3 steps"There was a problem installing the third-party software. To resolve this issue, contact Technical Support"

Oskar Laudo

I got this error while installing the support packages:
"There was a problem installing the third-party software. To resolve this issue, contact Technical Support"

The window: Oops! This page does not exist.

After that I followed the gnumex setting up installation tutorial for Matlab but still getting this error:

No supported compiler or SDK was found. You can install the freely available MinGW-w64 C/C++ compiler; see Install
MinGW-w64 Compiler. For more options, visit

How can I fix it?

Oskar Laudo

@Eric - Thanks again for alerting us. The message problem has been resolved.

@Eric - Thanks for alerting us to this message problem. We’re looking into it.


Is this a Mathworks supported product or team? Attempts to web-mail the team with the Contact link results in undeliverable mail:
Remote Server returned '554 5.7.0 < #5.7.133 smtp;550 5.7.133 RESOLVER.RST.SenderNotAuthenticatedForGroup; authentication required; Delivery restriction check failed because the sender was not authenticated when sending to this group>'

Jenny Zhang


Mushfequr Rahman

Finally managed to get the compiler installed. Thanks!

Samuel Whiteley

I had problems downloading and installing MinGW, giving me the error "Download Failed: Server returned HTTP response code: 504 for URL:". I am using Windows 10 Pro.

The solution that worked for me was to:
1. Download the compiler from a third party (e.g.
Follow instructions normally to install it onto the C:\ drive.
2. Manually Configure MinGW for MATLAB (

kareem El-safty

Mohammad Al Nagdawi

if anyone can't download files from this site. Use Firefox because with google chrome I can't download files with it here.


Once you download the file, open up matlab, navigate to where the file is located, and double click the file from within matlab "Current Folder". It will start installing itself.

This info should have been provided in the description.

Yang Tian

how to download the MATLAB Support for the MinGW-w64 C/C++ Compiler from TDM-GCC


cheng qian

i can't download this file

Please contact Technical Support for archive is not a ZIP archive errors

Vic A

Error installing third party software MinGW 4.9.2 Core: archive is not a ZIP archive

Kojiro Saito

I couldn't download the file for several minutes, but now I can.

Bernt Nilsson

This is great and it works well with several of our C mex files. It would be fantastic if the FORTRAN compiler (gfortran) was supported also. Is there anyone who has gfortran working and can provide an XML file for this? I have made fruitless tries myself with timestwo.F. It compiles without error but the linker returns errors.

Xiaofei Liu

What I have downloaded is file `mingw.mlpkginstall`, but it does not work, is there anything wrong?

Rafael García

I cannot download it! It sais: Problem at downloading third-party package, and the provided link in case of problem does not work. Can anyone help me?

mohsen bagherian



Fuad Numan

Anyone tried it on Win10 64bit? seems not working as well.

ibba abby


cao randoll

Download is not working at all

love you

Cone Alexandru

How can I install it on r2015a?? Thanks

Karan Patel

It works fine.

Jochem de Graas

I cannot install the compiler as I cannot download the compiler. The following message appears:

Download Failed: Server returned HTTP response code: 503 for URL:

HTTP response code 503 seems to be a "temporary service not available" response but this problem has occurred several times in the last weeks so it doesn't seem so temporary anymore.

Does anyone know what to do to install the compiler?


Karan Patel

Download is not working at all

yu smith

James Ryan

A few parts of the download seem to go by quickly (small rectangular popup with fuzzy text). Then there is a new small box labeled Downloads. It has a list of items starting with "GCC Base Files and C Support". Progress just sits there at zero percent. I tried last night, and again today after restarting everything.

Windows 7, MatLab R2016a.


Download does not work. At all.

farouk ALAO

I have window 10 and I have installed MatlabR2016a. I'm not able to download the MinGW-w64 C/C++ Compiler from TDM-GCC , could you please help me out?


Khashayar Olia

I'm not able to download the compiler, could you please help me out?


Ricolindo Carino

I was able to get TDM-GCC-64 gfortran (gcc 5.1.0) working with the included TDM-GCC-64 (gcc 4.9.2) in MATLAB R2015b. See my post at Anyone wish to validate?

@Abdul - You can find a list of supported compilers for MATLAB Compiler SDK at the following link. Sounds like you will need to install one of these.

Note that MinGW is not one of the supported compilers for MATLAB Compiler SDK.

Abdul Rashid Memon

I have window 10 and I have installed MatlabR2016a. It completes the whole installation and at the end shows the compiler problem. I have installed MATLAB compiler 6.2 and Matlab compiler SDK 6.2.
In warning message it shows
.....Matlab Compiler 6.2 requires supported compiler for creation of Excel add-ins
.....Matlab compiler SDK 6.2 requires .NETframework for creationof .NET assemblies.
and installation completes and doesn't even show the desktop icon and fly away.

Can anyone help me in completing the installation and run it on my computer...

Abdul Rashid

Abdul Rashid Memon

I am not able to download this compiler and run it on my computer. Can any one let me know how to use it ?

Ashvin Tharumanathan

I have tried installing the compiler multiple times however there is never any option to uncheck the box labelled "Check for updated files on the TDM-GCC server".

When I run "mex -setup" it recognizes the compiler is there but when I run "mbuild -setup" it tells me there is no compiler and that I should download one.

Can someone please help!

@Amit – What releases of MATLAB do you have installed? It may be that the .mlpkginstall file is not finding the correct version of MATLAB.

@Jay and @Sachin – It’s tough to say why the download may not be working. The best action would be to contact Technical Support and share details like a screenshot of the error. You might also check out the following links.

@Galen – MinGW Fortran is not currently supported with MATLAB.

@Lee – We’ve not seen this before. You might try running:
>> hwconnectinstaller.internal.inform('showmessage', true)
Then installing the MinGW Support Package

@Fubara – It’s tough to say what the issue is from this alone. Perhaps you can contact Technical Support and provide details about what’s in the make.m file along with the verbose output from MEX.

@Vladi - MinGW is not supported with deployment products. You might try MSVC or SDK 7.1 for deployment products.

Galen Hoffman

This installer worked well, but it did not include the MINGW Fortran package that I need (I am linking to Lapack). Is there any way to include Fortran with this? I tried manually installing the package from sourceforge ( but Matlab is not able to see the installation and link to it when I run the command "mex -setup" The simplest thing to do would be to add Fortran to the package.

Lee Hagood-James

I keep getting this error message when I try to run the installer.

Download Failed: Server returned HTTP response code: 416 for URL: ...

Any ideas why? The url is long and will not let me copy and paste. If it is needed I can type it

wang zhi


Sachin Lende

I have installed R2016a and when I ran max -setup it says no compiler found so I tried to install MinGW-w64 4.9.2 and during installation process support package installer asked for mathworks user id/password. I provided correct ID/pass all the times still it says "An error has occurred".
Can anyone help me out?

Vishal Suryanarayanan


Vladi Katz

I installed the above listing via windows 7 MATLAB R2016a successfully. However when I run:
mbuild -setup

I still get:
Error using mbuild (line 164)
Unable to complete successfully.
No supported compiler or SDK was found. You can install the freely available MinGW-w64 C/C++ compiler; see Install
MinGW-w64 Compiler. For more options, visit

How do I fix this?

For the past two weeks I've been trying to run the compiler on 3 different MATLABs, on various platforms, and I only managed to make it work on a linux system...


Fubara Warmate

I tried to build .mex files with MinGW64, this is what I get each time. I need help.
>> make
Building with 'MinGW64 Compiler (C)'.
Error: C:\Users\User\Downloads\libsvm-3.21\libsvm-3.21\matlab\make.m failed (line 13)
gcc: error: \-fexceptions: No such file or directory

Jay Meyer

Repeatedly get "Error: the application could not connect to MathWorks". I can connect and download other mathworks addons just fine.

Amit Kalita

When I click on to install the downloaded file, it asks for any app to open it. Is it not able to recognize any available app to open? How can this problem be resolved?

@Jan - MinGW OpenMP is not currently supported by MATLAB as noted on the Supported Compilers Page


Installation went just fine. However, I can't compile code using OpenMP, since I keep getting

gcc: error: libgomp.spec: No such file or directory

Sure enough, no such file exists on my machine. Usually, in mingw you can select packages to install (maybe OpenMP was not selected), but here I don't know how to add a package to the install.

omp.h is found allright.

@Ben – Good observation. We’ve now removed the checkbox (for 15b and 16a). Note that MinGW is not a supported compiler for MATLAB Compiler which can be used to create Microsoft Excel add-ins. You can see a list of supported compilers here:

@James – This may be caused by insufficient space in your %TEMP% directly. You might try clearing some items in the directly. Also the following Answers post may be relevant. If you continue to have trouble, please contact Technical Support.

@Yongchao – Have you tried uninstalling and reinstalling MinGW from Add-Ons?


Mex (No supported compiler or SDK was found),me too.

James Salvant

I keep getting this error

Error installing third party software MinGW 4.9.2 Core: archive is not a ZIP archive

Ben Li

I added MinGW-w64 a few times, but I never saw the window where I can uncheck the box.
My matlab is R2016a. I am not sure is that a problem?

I was using Excel add-in where C++ compiler is needed. The error message recommends me of adding MinGW-w64. It seems I added it successfully, but Excel add-in cannot find the compiler anyway.


@Adrienne - I suggest you try reinstalling. You can uninstall the current version through Add-Ons. Search for MinGW and select Manage and Uninstall. Then reinstall MinGW from Add-Ons.

Adrienne Siu

I downloaded MinGW-w64 (from tdm64-gcc-4.9.2.exe). However, when I try to install this Matlab support package, I get the error:

Error with pre-download command for package MinGW-w64 a C/C++ compiler from TDM-GCC: Error executing command

Undefined variable "mex_spkg" or class "mex_spkg.predownloadMinGW"..

Do you know a fix for this?

@Andy - You could try the following for C++ 11 functionality:

>> mex –setup C++ % choose mingw c++ compiler
>> mex –v <filename.cpp> CXXFLAGS='$CXXFLAGS -std=c++11'


Win7 R2016a: trying to compile using -std:c++11, but it doesn't work. Is there anything that should be configured for the c++11 support? (besides from setting the -std:c++11 flag?)
Already tested test file yprime.c and have no problem when compiling it.

@Tiffiny – It may be that you have the wrong MinGW version. You can uninstall the current version through Add-Ons. Search for MinGW and select Manage and Uninstall. Then reinstall MinGW from Add-Ons. During the installation, be sure to uncheck the box for "updated files". (MATLAB currently only supports MinGW 4.9, not newer versions)


My version is R2015b in 64-bit Windows10 system. After installing TDM-GCC, it gives the error messages which asks to uninstall and reinstall TDM-GCC again....

rongyu wang

and I have insatlled vs2015

Navid H

@SHASHANK MADHAV: I had the same problem. Make sure that MinGW Installation Folder Cannot Contain Space!


If you get an "Wrong compiler" error after installation try to set the needed environment variable MW_MINGW64_LOC="C:\TDM-GCC-64" manually. After that one can choose the compiler using mex -setup.

@Alexander: Yes – you can install offline. First, follow the steps in the following post:
Then invoke the Support Package Installer from MATLAB with the following command:

@Shashank: We’ll follow up with you offline for more information.


"Incorrect Installation directory for MinGW" Whats the solution

Alexander S

Is there a way to install this add-on offline? I can download TDM-GCC and install it, however cann not install this addon since I am behind a firewall.

srikanth kamlekar

Xiayun Zhao

Xiayun Zhao

Chris Ford

Is it possible import and run libraries like SDL,OPENGL,DIRECTX...etc into matlab?

Chen Junfeng

I'd like to use simulink of Matlab 2015b,therefore, I need this complier.

@Lars - You might try installing again through Add-On Explorer. If the problem persists, please contact Technical Support.


No success in installing. Found minGW in Add-on explorer, klicked Add and it went on forever, nothing happened, no network activity associated with MATLAB. Random community toolboxes and the like works though. Also tried to download and install separately as proposed by Brian Snider but I cannot get MATLAB to recognize it (I unchecked the tick box during install and ensured library name had no spaces). Not sure what Brian means when he says that addon installer will recognize it.



The issue has been resolved. Contact MathWorks if you continue to experience problems.

Anna Löbenberg

To all who had the same problem as I had: I tried installing the compiler again today and now it worked:)

Brian Snider

For those having issues installing this add-on you can go to source forge and manually install TDM-GCC-64 Version 4.9.2, Once that is installed you can run the addon installer in matlab and it will detect the correct version of TDM is installed and successfully register the add-on.

Link to the installer page:

Anh Le

Aaron Walsh

I also have the same problem as the last 3 comments.

Lucas delcourt


I have the same with the two pops up windows...


I have the same problem as Anna Löbenberg. While installing I never get the opportunity to uncheck the box, instead the warning window telling me to do so, pops up twice. Do you have a solution? Thank you

Anna Löbenberg

I tried to install this compiler for many times now. The window that tells me where to uncheck the box is popping up even twice. But the window where I may uncheck the box is not appearing anywhere. So - at the end I get the message that I have installed the wrong version of the compiler. I am really wondering why?

Dave Bergstein

@Martin - Thank you for letting us know. We are currently investigating the issue.

Martin Cuma

Just tried to install the add on today and failed. After some fishing around it looks like the link to the TDM-GCC archive has changed, as that would be the tdm64-gcc-4.9.2.exe executable is a text file with:

301 Moved Permanently
The resource has been moved to {}; you should be redirected automatically.

I appreciate if you could check into this and if applicable fix the add on.

Dave Bergstein

@Luqman - There is a check box for updates during the installation. If you do not clear the check box, TDM-GCC installs an unsupported version and MATLAB displays the following error message: "MinGW compiler not setup for use with MEX. Please install MinGW version 4.9.2"

In this case you should uninstall and then reinstall the compiler from the Add-Ons menu. Be sure to clear the box for "Check for updated files on the TDM-GCC Server".

For more information about installing MinGW-w64, see "Install MinGW-w64 Compiler":

Luqman Subki

I got compiler setup failed at the end with the following error:
'MinGW compiler not setup for use with MEX. Please install Min GW version 4.9.2'

Any suggestion what should i do?

Abbas Cheddad

Hi Dave,

It is working for me now.

Thank you!

Dave Bergstein

@Abbas: Thanks for sharing this comment. Hopefully I can clear this up a bit for others.

The File Exchange entry installs support for the MinGW GCC version 4.9.2 from TDM-GCC along with the MinGW GCC compiler. Be sure to uncheck the update box as described in the help link to avoid installing a different version of MinGW (should be GCC 4.9.2). The version number 15.2.1 that you see refers to the whole package (MATLAB compiler support and the compiler), it is not necessarily related to the version of GCC installed.

Abbas Cheddad

I followed the exact instructions. When "Select support package to install" window pops-up, a display of MinGW Ver. 4.9.2 on the left hand side panel is displayed but on the right hand side one Ver 15.2.1 is displayed instead. Unchecking the update check-box is useless in this case as it installs Ver 15.2.1 anyway.

Even on the main Add On window it says:

"MATLAB Support for the MinGW-w64 C/C++ Compiler from TDM-GCC version"

And right underneath it:

"Install the MinGW-w64 compiler for Windows (GCC version 4.9.2)"!!


MATLAB Release Compatibility
Created with R2015b
Compatible with R2015b to R2020b
Platform Compatibility
Windows macOS Linux

Inspired: YOKOGAWA GM10 communication interface