Error when doing Real-Time Simulink in External Mode "Unable to create mex function"
조회 수: 22 (최근 30일)
이전 댓글 표시
Dear Sir/Madame,
I am trying to do Real-Time simulatation of a vehicle model that is built in simscape.
I have already done all prepration and configuration needed to perform RT simulation. Moreover, I have successfully simulated a pure EV model in Target Computer. So all the connection are okay. Now, I want to do the same with Engine-based model but I receive the following error message.
What causes this error? Thank you.
"Making simulation target "ICE_PID_test1_v2_rt_sfun", ... Microsoft (R) Program Maintenance Utility Version 14.00.23918.0 Copyright (C) Microsoft Corporation. All rights reserved. ### Compiling "ICE_PID_test1_v2_rt_sfun.c" cl.exe /c /Zp8 /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD /I "C:\Program Files\MATLAB\R2016b\extern\include" /I "C:\Program Files\MATLAB\R2016b\simulink\include" /I "C:\Program Files\MATLAB\R2016b\simulink\include\sf_runtime" /I "C:\Program Files\MATLAB\R2016b\stateflow\c\mex\include" /I "C:\Program Files\MATLAB\R2016b\rtw\c\src" /I "D:\Documents\MATLAB-simulation\xPC Target\slprj\_sfprj\ICE_PID_test1_v2_rt\_self\sfun\src" "ICE_PID_test1_v2_rt_sfun.c" ICE_PID_test1_v2_rt_sfun.c c:\program files\matlab\r2016b\extern\include\tmwtypes.h(788): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\Bin\amd64\cl.exe"' : return code '0x2' Stop.
Component:Make | Category:MakeerrorOpen
Unable to create mex function 'ICE_PID_test1_v2_rt_sfun.mexw64' required for simulation."
답변 (2개)
SAnbaran
2019년 10월 23일
댓글 수: 1
Jason Williamson
2020년 10월 27일
Sajad,
Which 'stddef.h' header file did you add and where did you add it to? I have found several different sttdef.h files in the MATLAB program files and was not sure which to add or where to add it. Also, in the /I paths I did not have the path that is not underlined, the stateflow path. Did you have to add that as well? I'm experiencing the exact same issue and have as of yet been unable to solve it.
Diego Kuratli
2019년 10월 21일
Are you using Simulink Real-Time as System target file in your model Configuration Parameters?
Try to clear the SLRT compiler:
>> slrtsetCC('VisualC','')
Then, select the compiler by using
>> mex -setup
Delete all build files and folders in your workspace, and try to build again your model.
댓글 수: 3
Diego Kuratli
2019년 10월 22일
I would try to comment out part of the models, one after the other, and see which one causes the issue.
참고 항목
카테고리
Help Center 및 File Exchange에서 Model Preparation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!