Simulink crashes when running MEX functions created with Visual Studio 2022 17.10.4

3 visualizzazioni (ultimi 30 giorni)
We have been running MATLAB R2023B Update 7 with Simulink models using S-Functions built with VS 2022 17.9.0. When we updated to VS 2022 17.10.4 we starting having MATLAB crashes as soon as Simulink starts executing models with these MEX functions. Is this a known issue, and do we know if moving to Update 8 or 9 will fix it?

Risposta accettata

Benjamin Thompson
Benjamin Thompson il 13 Set 2024
I guess I can answer my own question with some help from an older post and some great help from the MATLAB support team.
MATLAB R2023B Update 7 through 9 are delivered with a version of MSVP140 DLLs that is not compatible with a change in MSVCP runtime that happened sometime after the 17.9.0 release and the 17.10.4 release, not sure exactly when. This can be fixed after installing VS 2022 17.10.4 or later (MSVC runtime 14.40.x) if you go to the Windows\System32 folder and copy all the MSVCP140 DLLs (there are maybe 5 of them depending on the VS 2022 package options you chose) to the MATLAB bin\win64 folder.
If using the MATLAB runtime, do the same thing in the MATLAB Runtime\R2023B\...not sure...\bin\win64 folder. But don't go replacing every copy of those DLLs you can find because applications or certain parts of MATLAB may truly depend on the older runtime version.

Più risposte (0)

Categorie

Scopri di più su Simulink Coder in Help Center e File Exchange

Prodotti


Release

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by