I am new to Matlab and I am trying to mex .c files for the ADM1 model. I have the 64bit program and installed the Visio compiler. I did the mex -setup successfully but when I try to mex the .c files I get the following error message:
>> mex adm1_DAE1.c
adm1_DAE1.c
adm1_DAE1.c(19) : fatal error C1083: Cannot open include file: 'simstruc.h': No such file or directory
C:\PROGRA~1\MATLAB\R2010B\BIN\MEX.PL: Error: Compile of 'adm1_DAE1.c' failed.
??? Error using ==> mex at 208
Unable to complete successfully.
Anyone have any ideas what the problem is?
Thanks
I assume this is the header file for the simulink tootbox (which I have never used)
do you need to download and install the toolbox? set up paths, etc?
Does that make sense to anyone?
also I have found this
"Matthew " < - > wrote in message <i7ptrd$q9s$ - >...
> Since updating to 2010b, when ever I try and mex a .cpp file I get the error: Fatal Error C1083: Cannot open include file: 'simstruc.h': No such file or directory. This even happens using Simulinks own S-Function Builder. When I look for the file I see that it is in Matlab\Simulink\Include. Were is the path setup for Simulink mex and why did this change from 2010a?
>
> Thanks,
> Matt
Fixed per Bug Report 661855, for some reason that doesn't show up on Google!?
I have the same problem ,you can modify the file mexopts.bat .and find the line "set INCLUDE" then add the following string "%MATLAB%\simulink\include;"
To be honest, this still doesn't explain or clear-up anything for me
and that worked
"set INCLUDE=%MATLAB%\simulink\include;%VCINSTALLDIR%\INCLUDE;%VCINSTALLDIR%\ATLMFC\INCLUDE;%LINKERDIR%\include;%INCLUDE%"
and it worked. Thanks for the help all!