How I can set Microsoft Visual Studio 2017 compilers with MATLAB R2021a?
74 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Adnan Ghaderi
il 28 Dic 2022
Commentato: Adnan Ghaderi
il 9 Gen 2023
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)'.
0 Commenti
Risposta accettata
Guru Kumaresan
il 9 Gen 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.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su MATLAB Support for MinGW-w64 C/C++ Compiler in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!