how to enable mex detect the C/C++ compiler (integrated in Visual Studio 2022) on older MATLAB (R2018b) ?

33 ビュー (過去 30 日間)
My matlab version is 2018b, and visual studio version is 2022.
I want matlab to detect the compiler integrated in the visual studio
(path:Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\Hostx64\x64\cl.exe)
I tried to copy and modify the associated xml file, however, I found for the newest matlab, it is only support the oneAPI.
I don't know how to modify the xml file, and I have not found something similar to solve this problem.
EDIT: I (Bruno) wrongly edit the question, sorry
  5 件のコメント
Biyi Wang
Biyi Wang 2024 年 10 月 1 日
編集済み: Biyi Wang 2024 年 10 月 1 日
Thanks for your nice reply!
I indeed chose the wrong reference before.
Now I just copy the msvc2022.xml msvcpp2022.xml to [matlabroot '\bin\win64\mexopts\'].
Then use the command
mex -setup C
mex -setup C++
There is no need to modify the xml file, and now matlab can detect my Visual Studio compiler.
Bruno, I really appreciate for your help!

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2024 年 10 月 1 日
My matlab version is 2018b, and visual studio version is 2022.
MATLAB R2018b has no support for VS 2018 or later.

カテゴリ

Help Center および File ExchangeWrite C Functions Callable from MATLAB (MEX Files) についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by