How do I make MATLAB 2019b mex run with Visual C++ Build Tools 2015 compiler?

31 次查看(过去 30 天)
After installing MATLAB 2019b I made a complete Installation of Visual C++ Build Tools 2015, including Windows 8.1 SDK, in order to generate specific .mex-files (MinGW was not an option here).
However, running
>> mex -v -setup c++
results in the following output:
...
... Looking for compiler 'Microsoft Visual C++ 2015' ...
... 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 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\').
... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe' ...Yes.
... Looking for folder 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC' ...Yes.
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...Yes ('C:\Program Files (x86)\Windows Kits\8.1\').
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 14.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 14.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 14.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 14.0 ...No.
... 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 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 15.0 ...No.
Did not find installed compiler 'Microsoft Visual C++ 2015'.
...
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,
Re-running the Visual C++ Build Tools 2015 setup in order to check the installation, it turned out that the Windows 8.1 SDK checkbox was now unchecked, although I explicitly checked it before installation.
It seems to me that this problem might be related to this issue here:
If a similar solution is applicable to my issue, then I am not sure how to obtain the right SDK 8.1 files and the corresponding patches, if they exist for SDK 8.1.
What steps are necessary in order to make Visual C++ Build Tools 2015 run with mex in MATLAB 2019b? Can you please give a complete solution (like in the aforementioned issue)?
Thank you very much in advance for your help.

采纳的回答

Marcus Herbst
Marcus Herbst 2020-1-15
This post here contains the solution to the problem:
Accordingly, adding the following entry to the registry made mex run with Visual C++ Build Tools (see attachment):
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VS7]
"14.0"="C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\"
(It turned out to be no use manipulating either $matlabroot\bin\win64\mexopts\msvcpp2015.xml
and/or \AppData\Roaming\MathWorks\MATLAB\R2019b\mex_C++_win64.xml).
Thank you very much Stanislav Tereschenko for this straightforward solution!
Best regards
Marcus

更多回答(1 个)

shubham kumar gupta
编辑:shubham kumar gupta 2021-2-4
I have uploaded 5 regedit export files in this Gdrive link which can solve your issue
[CAUTION EDIT LOCATIONS WHERE YOU HAVE INSTALLED YOUR VS]
This may help you to resolve missing keys
by clicking on edit you can see written inside them, after that you can also edit/export by yourself.
Also check your env paths here

类别

Help CenterFile Exchange 中查找有关 Troubleshooting in MATLAB Compiler SDK 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by