MATLAB Answers

0

Microsoft Visual Studio 2017 is not detected in Matlab 2018b

Asked by amin ya on 13 Oct 2018 at 8:40
Latest activity Commented on by Bruno Luong on 14 Oct 2018 at 8:12

I have installed Microsoft Visual Studio 2017 community, but when I run:

mex -setup

I get this error:

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
https://www.mathworks.com/support/compilers.

I installed Microsoft Visual Studio in another drive (not C) on Windows 8.1. I have attached the screenshot of Visual Studio components that I have installed.

    >> mex -v -setup
    Verbose mode is on.
    ... Looking for compiler 'Intel Parallel Studio XE 2015 with Microsoft Visual Studio 2015 (C)' ...
    ... Looking for environment variable 'ICPP_COMPILER15' ...No.
    Did not find installed compiler 'Intel Parallel Studio XE 2015 with Microsoft Visual Studio 2015 (C)'.
    ... Looking for compiler 'Intel Parallel Studio XE 2016 with Microsoft Visual Studio 2015 (C)' ...
    ... Looking for environment variable 'ICPP_COMPILER16' ...No.
    Did not find installed compiler 'Intel Parallel Studio XE 2016 with Microsoft Visual Studio 2015 (C)'.
    ... Looking for compiler 'Intel Parallel Studio XE 2017 with Microsoft Visual Studio 2015 (C)' ...
    ... Looking for environment variable 'ICPP_COMPILER17' ...No.
    Did not find installed compiler 'Intel Parallel Studio XE 2017 with Microsoft Visual Studio 2015 (C)'.
    ... Looking for compiler 'Intel Parallel Studio XE 2017 with Microsoft Visual Studio 2017 (C)' ...
    ... Looking for environment variable 'ICPP_COMPILER17' ...No.
    Did not find installed compiler 'Intel Parallel Studio XE 2017 with Microsoft Visual Studio 2017 (C)'.
    ... Looking for compiler 'Intel Parallel Studio XE 2018 with Microsoft Visual Studio 2015 (C)' ...
    ... Looking for environment variable 'ICPP_COMPILER18' ...No.
    Did not find installed compiler 'Intel Parallel Studio XE 2018 with Microsoft Visual Studio 2015 (C)'.
    ... Looking for compiler 'Intel Parallel Studio XE 2018 with Microsoft Visual Studio 2017 (C)' ...
    ... Looking for environment variable 'ICPP_COMPILER18' ...No.
    Did not find installed compiler 'Intel Parallel Studio XE 2018 with Microsoft Visual Studio 2017 (C)'.
    ... Looking for compiler 'MinGW64 Compiler (C)' ...
    ... Looking for environment variable 'MW_MINGW64_LOC' ...No.
    Did not find installed compiler 'MinGW64 Compiler (C)'.
    ... Looking for compiler 'Microsoft Visual C++ 2013 (C)' ...
    ... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
    ... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
    ... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
    ... Looking for registry setting 'HKCU\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
    Did not find installed compiler 'Microsoft Visual C++ 2013 (C)'.
    ... Looking for compiler 'Microsoft Visual C++ 2015 (C)' ...
    ... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VC7' 14.0 ...No.
    ... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VC7' 14.0 ...No.
    ... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VC7' 14.0 ...No.
    ... Looking for registry setting 'HKCU\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VC7' 14.0 ...No.
    Did not find installed compiler 'Microsoft Visual C++ 2015 (C)'.
    ... Looking for compiler 'Microsoft Visual C++ 2017 (C)' ...
    ... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 15.0 ...No.
    ... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 15.0 ...No.
    ... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 15.0 ...Yes ('D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\').
    ... Executing command 'set "vcroot=D:\Program Files (x86)\Microsoft Visual Studio\2017\Community"&for /f "delims= " %a in ('type "D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt"') do @if exist "D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\%a\bin\HostX64\x64\cl.exe" call echo %vcroot%' ...Yes ('D:\Program Files (x86)\Microsoft Visual Studio\2017\Community').
    ... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0' InstallationFolder ...No.
    ... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0' InstallationFolder ...No.
    ... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0' InstallationFolder ...No.
    ... Looking for registry setting 'HKCU\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0' InstallationFolder ...No.
    Did not find installed compiler 'Microsoft Visual C++ 2017 (C)'.
    ... Looking for compiler 'MinGW64 Compiler (C)' ...
    ... Looking for environment variable 'MW_MINGW64_LOC' ...No.
    Did not find installed compiler 'MinGW64 Compiler (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
    https://www.mathworks.com/support/compilers.

  3 Comments

I installed Microsoft Visual Studio in another drive (not C) on Windows 8.1.

Certainly this doesn't help MATLAB to detect it.

What do you suggest so?

The reason I put in the comment because I don't want to involve in any suggestion.

Sign in to comment.

1 Answer

Answer by Image Analyst
on 13 Oct 2018 at 15:03
Edited by Image Analyst
on 13 Oct 2018 at 15:04

Are you sure you installed the C package, and not just some other packages like VB or something? If so, then call the Mathworks and ask them. I had the same problem (only VB) and it couldn't find a compiler until I modified the installation to add C.

  1 Comment

I guess so! See the image I have attached. I modified the installation a little, but I left things which I thought was needed.

Sign in to comment.