MATLAB: .mdl to .dll

akashsimulink coder

I want to convert my .mdl to .dll as I have to use it for Hyperworks Motionsolve.I built a simple model in simulink for example (involving 1 input, output port and 1 discrete statespace block), chose the following configuration parameters:
Type: fixed step
Solver:ode3(bogaki)
Target file : grt.tlc (create VC/C++ solution file for the grt target)
Language : C++
Make command : make_rtw
Template makefile :RTW.MSVCBuild
I chose the compiler as MS visual studio 2010 by the 'mex -setup' command in matlab command window. I use the windows 7 OS 32bit, Matlab R2011b
When the build button is selected, throws error –
Invoke error, dispatch exception
Source:Microsoft Visual Studio.Shell.10.0
Description: index
What might be the problem? Looking forward for your help

Best Answer

My guess is that the "create VC/C++ solution file for the grt target" option causes Microsoft Visual Studio to be invoked via its COM interface in order to create the solution file, and it is likely your Visual Studio installation is not registered as a COM Server. What happens of you choose "grt.tlc - Generic Real-Time Target" instead? Also, when you ran mex -setup, was the utility able to locate your compiler automatically, or did you have to manually specify its path?