Effacer les filtres
Effacer les filtres

Error using sfcnbuilde​r.createCo​mpileCSfun Error while obtaining sizes from MEX S-function

23 vues (au cours des 30 derniers jours)
Hello together,
I do have troubles compiling a C-Code into a S-function using the S-Function builder block in simulink. I did compile the same code (excluding different library paths obvisouly) with MinGW64 on another Computer using Matlab R2021b and the mex-File works perfectly within the simulink model.
However on the other Laptop with Matlab R2022a the C-Code also is compiled and a mex-File is generated. But immediately after that I receive an error saying:
Error using sfcnbuilder.createCompileCSfun Error while obtaining sizes from MEX S-function 's_fun_name' in 'model_v2/Subsystem/Subsystem1/Subsystem2/C//C++ Code Block'. - Show complete stack trace Caused by: Error using sfcnbuilder.createCompileCSfun Invalid MEX-file 'workingfolder\s_fun_name.mexw64': Das angegebene Modul wurde nicht gefunden. - Show complete stack track
and the all three Code-Files (.c, .c_wrapper & .mexw64) are deleted from the working folder. If you click on show complete stack track nothing happens.
Anybody had similar troubles?
Kind regards

Réponses (1)

Kausthub
Kausthub le 28 Déc 2023
Hi Eyzie,
I understand that you are facing an error while using the S-Function builder to build your S-Function. From the error message, “Error while obtaining sizes from MEX S-Function” is caused due to the “specified module could not be found” error.
I believe that there are two possible reasons for “specified module could not be found” error:
  • Some of the required DLL files are missing i.e., you do not have all the necessary libraries that the MEX-function is dependent upon.
  • You are running a MEX-file on a different version of MATLAB than it was compiled on.
You could refer to these articles which explains how to solve the error in detail:
Hope it helps!

Catégories

En savoir plus sur Simulink Functions dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by