mex and the Visual Studio Community 2022 C/C++ compiler

조회 수: 24 (최근 30일)
Bogdan Udrea
Bogdan Udrea 2022년 3월 2일
댓글: Ben 2025년 8월 19일
Dear Colleagues,
I have recently installed Visual Studio Community 2022 because the C/C++ compiler is required by Quanser/QUARC. The default installation is not compatible with MATLAB mex so the
>>mex -setup
command returns an error.
After a bit of trial an error I have found that selection of the MSVC v140 - VS 2015 C++ build tools installs the 2015 version of the compiler that is compatibe with mex. Consequwntly, I can set it up mex and I am able to run the Quanser QUARC demos.Please see below the screenshot obtained from the Modify option of the VS Community 2022 installer app.
After this installation I get
>> mex -setup
MEX configured to use 'Microsoft Visual C++ 2015 (C)' for C language compilation.
I am writing to ask if anyone has a experience with the VS Community C/C++ compilers in general and if anything else is needed from this option list. I will update this thread if I find missing options.
Thank you.
BU
  댓글 수: 8
nicholas roche
nicholas roche 2024년 9월 12일
Thanks for sharing @Bogdan Udrea - the little detail of which MSCV version to install to get MATLAB to recognise Visaul C++ as a compiler option saved me time today.
Ben
Ben 2025년 8월 19일
For me, none of these comments got it working.
In my case, I could only select the VS C++ build tools within MATLAB, after I had installed the Windows (10) SDK using the VS installer.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Troubleshooting in MATLAB Compiler SDK에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by