Effacer les filtres
Effacer les filtres

How I can set Microsoft Visual Studio 2017 compilers with MATLAB R2021a?

65 vues (au cours des 30 derniers jours)
Can I use Microsoft Visual Studio 2017 compilers with MATLAB R2021a?
I want to use mexopencv, but I can't set Microsoft Visual Studio 2017 in MATLAB, evenso I installed VS2017.
This is error when I am running mexopencv and mex -setup:
Error using mexOpenCV (line 73)
The OpenCV libraries were built using 'Microsoft Visual C++ 2017'.
Your compiler is 'MinGW64 Compiler (C)'.
These compilers may not be compatible.
Note that you can select a compiler using 'mex -setup' command.
>> mex -v -setup
... 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 ('C:\Program Files (x86)\Microsoft Visual Studio\2017\TeamExplorer\').
... Executing command 'set "vcroot=C:\Program Files (x86)\Microsoft Visual Studio\2017\TeamExplorer"&for /f "delims= " %a in ('type "C:\Program Files (x86)\Microsoft Visual Studio\2017\TeamExplorer\VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt"') do @if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\TeamExplorer\VC\Tools\MSVC\%a\bin\HostX64\x64\cl.exe" call echo %vcroot%' ...No.
Did not find installed compiler 'Microsoft Visual C++ 2017 (C)'.

Réponse acceptée

Guru Kumaresan
Guru Kumaresan le 9 Jan 2023
Hi Adnan,
By looking at the output from "mex -v -setup", the issue is caused by the Windows registry entry not pointing to the correct installation folder.
To resolve this issue for Visual Studio 2017, please reinstall it in "C:\Program Files (x86)\Microsoft Visual Studio\2017" and run "mex -v -setup" in MATLAB.
Since MATLAB has stopped relying on the registry entry from Visual Studio 2019, such issues will not be there with VS 2019 and later versions of VS.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB Compiler dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by