Invalid MEX-file 'C:\research_project\8-01-10\mymexfile.mexw32': This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.
.........................................
I have deleted the previous mymexfile.mexw32 from my working directory and rebuilt it, as I figured that it might need to be built on the new PC; however, this hasn't resolved this error.
What might be the problem? If the mex file cited in the error message *is* located in my working directory, and it worked on my previous PC, why does the error message now say that my mex-file is 'invalid'?
Thanks for any input anyone has.
An S-Function "controller_CMEXsfcn" would usually call mdlInitializeSizes from some controller_CMEXsfcn.mexw32 but from mymexfile.mexw32. Maybe you provide us with the code from controller_CMEXsfcn:mdlInitializeSizes or whatever you really run. If you're not allowed to, you must reproduce the problem with some neutral example model/code and post it.
Chears,
Robert
Does that change anything?
Error while obtaining sizes from MEX S-function 'controller_CMEXsfcn' in 'Host_model/S-Function'. MATLAB error message:
Invalid MEX-file 'C:\research_project\8-01-10\controller_CMEXsfcn.mexw32': This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.
Looks like you're still running an old dll. Running "which('controller_CMEXsfcn', '-ALL')" could possibly give a hint. If you run the newly built mex your matlab and mex-compiler installation must be fixed, see "Solution 1-2223MW" on the mathworks homepage:
http://www.mathworks.com/support/solutions/en/data/1-2223MW/?solution=1-2223MW
Cheers,
Robert
It looks like your MEX file has dependencies that are not on the new computer. Most likely MSVC++ run-time libs. The mex function spews a warning about installing the right run-time libs on any machine that needs to load & run a MEX file.
You will need to find an appropriate vcredist_x86.exe or vcredist_x64.exe from the Microsoft website. The version you need will depend on what compiler version built your MEX file.
Here is a TMW technical solution for VS2005-compiled MEX files. It may not be the exact answer, but it is the same problem.
http://www.mathworks.com/support/solutions/en/data/1-2223MW/