installed compiler not found
Show older comments
I have installed the MinGW-w64 compiler but I still get an error message when trying to compile a cc file:
>> mex -setup c
MEX configured to use 'MinGW64 Compiler (C)' for C language compilation.
>> mex -setup c++
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
>> mex 'keyInject_setFocus.cc'
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
The same works fine on Matlab 2017b. Suggestions?
Answers (2)
Aghamarsh Varanasi
on 12 Nov 2020
0 votes
Hi Raphael,
Firstly, make sure that you have installed the complete version of the MinGW compiler from the add-on section of MATLAB, as custom installations of MinGW compiler may not be compatible with MATLAB.
7 Comments
Raphael
on 12 Nov 2020
Aghamarsh Varanasi
on 13 Nov 2020
Edited: Aghamarsh Varanasi
on 13 Nov 2020
Hi Raphael,
I get that you have installed MinGW support package from the add-on section of MATLAB.
I suggest you to run these commands in the windows command prompt and give the outputs so that we can try to understand the root cause of the issue. Please ensure that the MinGW installation folder is added to the windows path.
- g++ --version
- g++ -dumpmachine
- mex -setup cpp
Raphael
on 15 Nov 2020
Walter Roberson
on 15 Nov 2020
run the commands at the windows command prompt not the matlab command prompt.
Shashwat Singh
on 7 Mar 2024
Hi @Aghamarsh Varanasi , i don't have the maintenance services enabled to my MATLAB and therefore i am not able to download it from MATLAB addon...so in this situation what can i do to use the Mex compiler.
I have Microsoft Visual C++ 2017 , but still Mex is not able to work with this.
What shall i do in this situation???
Walter Roberson
on 7 Mar 2024
Shashwat Singh
on 7 Mar 2024
Edited: Shashwat Singh
on 7 Mar 2024
Hi @Walter Roberson , first of all thanks for the quick reply.....when i am going to above link which you have mentioned, then it is downloading "mingw.mlpkginstall" and when i am double clicking on it then it is giving me below error...
Connection Error
The application could not connect to MathWorks. For more information on resolving this issue, see this Support Article.
Please help if you know the resolution
Raphael
on 15 Nov 2020
0 votes
5 Comments
Aghamarsh Varanasi
on 16 Nov 2020
Hi Raphael,
Make sure you have 'g++.exe' installed under "C:\ProgramData\MATLAB\SupportPackages\R2020b\3P.instrset\mingw_w64.instrset\bin" folder. If you do not find 'g++.exe', I recommend you to uninstall and re-install the MinGW support package for MATLAB from the Add-Ons Manager.
Raphael
on 16 Nov 2020
Aghamarsh Varanasi
on 16 Nov 2020
Edited: Aghamarsh Varanasi
on 16 Nov 2020
Hi Raphael,
You can navigate to the folder that contains the MinGW installation and execute these commands in the "windows command prompt" and send back the output. This helps to get a understanding of the underlying issue.
Steps to execute the following commands :
- Open Windows command prompt, by typing 'cmd' in the windows search bar. Click enter to open the windows command prompt.
- Execute the command
> cd C:\ProgramData\MATLAB\SupportPackages\R2020b\3P.instrset\mingw_w64.instrset\bin
to navigate to the MinGW installation folder
3. Execute the following commands
> .\g++.exe --version
> .\g++.exe -dumpmachine
4. Run the 'mex' setup command in the same location in the windows command prompt
> mex -setup cpp
Thanks
Raphael
on 16 Nov 2020
Aghamarsh Varanasi
on 16 Nov 2020
Hi Raphael,
I understand that you have installed MinGW support package for MATLAB, but are not able to setup mex.
The outputs that you for the commands also suggest the same. As I am not able to reproduce the same at my end, I suggest you contact MathWorks support to resolve the issue.
Thanks
Categories
Find more on MATLAB Support for MinGW-w64 C/C++ Compiler in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!