Invalid MEX-file

11 views (last 30 days)
TEJASHREE
TEJASHREE on 15 May 2012
hi, will any body please help me to sort out the following error while using the real time workshop generated S-Function :
Error while obtaining sizes from MEX S-func 'Pump_sf' inlPump at Startup/Pump at Startup_sfcn'. MATLAB error message:
Invalid MEX-file 'C:\Programme\Pump_sf.mexw32': The specified procedure could not be found.

Accepted Answer

Kaustubha Govind
Kaustubha Govind on 15 May 2012
Was the S-Function generated on your machine, or elsewhere? The error about "The specified procedure could not be found." usually occurs when the MEX-function tries to load additional libraries that are not present on your system. Assuming that the S-function doesn't explicit load any DLLs, the most likely issue is that the S-function was compiled with some version of Microsoft Visual Studio and depends on the Visual Studio redistributables corresponding to that version. You need to find out which version of Visual Studio was used and install the right distributables.
  4 Comments
Julio
Julio on 19 May 2012
Hi . I have similiar problem , The mistake message says:
"MATLAB Function Interface Error: Error calling generated SFunction, Face_sfun. Invalid MEX-file 'E:"
but my proyect is located in "E:\FaceDetecSimulink\Detec_Begin" when I execute my proyect , It generates a folder "slprj" and inside this folder there are folders "_sfprj\Face\_self\sfun" and in the folder "sfun" there are many files called "Face_sfun" as appear in the mistake,with diferent extensions as : .exp,.lib,.bat,.c,.h,.lmk,.lmko,.obj and others files with similar names with "Face_sfun".
When I executed my proyect It worked Ok , but when I change something and I execute it again,It didn't work , so I tried to remove the files and folders generated and I execute my proyect again and suddenly it work , now I do it again, but now It don't work.
I have just used the "dependency walker" , where do I have to put the DLLs?.
Kaustubha Govind
Kaustubha Govind on 21 May 2012
Julio: Do you always work on the same machine, or do you switch between machines and work on a shared/network drive? Are the missing DLLs related to Visual Studio? If yes, just install them anywhere, but add them to the System PATH environment variable. You will need to restart MATLAB for it to see the new PATH variable.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!