Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

fatal error C1083: Cannot open include file: 'simstruc.h': No such file or directory

1,412 views
Skip to first unread message

Michael O Loinsigh

unread,
Jan 7, 2011, 7:25:08 PM1/7/11
to
Hi

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

Michael O Loinsigh

unread,
Jan 8, 2011, 5:31:05 AM1/8/11
to
This a reply I got from another forum

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

Michael O Loinsigh

unread,
Jan 8, 2011, 8:52:03 AM1/8/11
to
Can anybody help with this? Please

Michael O Loinsigh

unread,
Jan 8, 2011, 6:35:04 PM1/8/11
to
Does anyone know how I can modify the the mexopts.bat file or do i have to install and update if there was a bug as is indicated in the above message.

Michael O Loinsigh

unread,
Jan 9, 2011, 6:16:04 AM1/9/11
to
OK I have fund the mexopts.bat file and found the line "set INCLUDE" then added the following string "%MATLAB%\simulink\include;"

and that worked

Hashim Mazhar

unread,
Jul 15, 2011, 4:19:13 PM7/15/11
to
I found the mexopts.bat in C:\Users\*yourUsername*\AppData\Roaming\MathWorks\MATLAB\R2010b and added the string "%MATLAB%\simulink\include;" right after where it says "set INCLUDE = " so that it finally looks something like this:

"set INCLUDE=%MATLAB%\simulink\include;%VCINSTALLDIR%\INCLUDE;%VCINSTALLDIR%\ATLMFC\INCLUDE;%LINKERDIR%\include;%INCLUDE%"

and it worked. Thanks for the help all!

jno navarro

unread,
Mar 29, 2012, 2:11:12 PM3/29/12
to
"Hashim Mazhar" <hashim...@gmail.com> wrote in message <ivq7c0$ktr$1...@newscl01ah.mathworks.com>...
> I found the mexopts.bat in C:\Users\*yourUsername*\AppData\Roaming\MathWorks\MATLAB\R2010b and added the string "%MATLAB%\simulink\include;" right after where it says "set INCLUDE = " so that it finally looks something like this:
>
> "set INCLUDE=%MATLAB%\simulink\include;%VCINSTALLDIR%\INCLUDE;%VCINSTALLDIR%\ATLMFC\INCLUDE;%LINKERDIR%\include;%INCLUDE%"
>
> and it worked. Thanks for the help all!

Thank you so much! I did and now it works perfectly.
Thank you

Marco

unread,
Apr 25, 2013, 3:37:09 AM4/25/13
to
"Michael O Loinsigh" wrote in message <ig9q62$pfm$1...@fred.mathworks.com>...
0 new messages