- If an S-Function has TLC inlining files, then the "S-function modules" parameter in the S-Function block should be left blank. Setting the "S-function modules" parameter to the name of MEX source code for the S-Function introduces non-inline MEX source code into the build process. This results in an error message because the build process recognizes that the S-Functions were inline with TLC, so it doesn't include the -DRT on the compile line.
- If the C/C++ MEX S-Function file contain the ‘#define MATLAB_MEX_FILE’ preprocessor directive, then this directive should be removed from the C/C++ MEX S-Function file. The definition will automatically be included in the compiler arguments when the MEX file is built. For information on creating a C MEX S-Function, refer to the following documentation page: https://in.mathworks.com/help/simulink/sfg/example-of-a-basic-c-mex-s-function.html
- If you are attempting to build the code in an external IDE and receiving these error messages, then try to ensure the required defines are set properly. You can find the required defines in the text file in your model's code generation directory. Check to see if any compiler flags (for example, RT or USE_RTMODEL) should be added to the external IDE and verify that the following folder is included by the external IDE: <matlabroot>\extern\include
receive the err 1189
조회 수: 3 (최근 30일)
이전 댓글 표시
fatal error C1189: #error : Must define one of RT, NRT, MATLAB_MEX_FILE, SL_INTERNAL, or FIPXT_SHARED_MODULE
댓글 수: 0
답변 (1개)
Vidip
2024년 6월 7일
The error message you're encountering, fatal error C1189: #error: Must define one of RT, NRT, MATLAB_MEX_FILE, SL_INTERNAL, or FIPXT_SHARED_MODULE, typically occurs during the compilation of MATLAB MEX files or Simulink models that interface with C/C++ code.
This issue has several possible root causes. Here are some troubleshooting steps you can try to find the root cause of the issue:
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Code Generation for Custom Blocks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!