Why do I get an ‘undefined reference to '_myfunction’ ' error while building my model containing a C S-function using Real-Time Workshop 7.6 (R2010b) ?

조회 수: 9 (최근 30일)
I want to create a standalone application from a basic Simulink model containing only an S-function. This S-function contains C code generated from an external source. For the standalone generation, I use Real-Time Workshop with the rsim.tlc system target file.
The generation fails due to undefined references to 3 functions.
These 3 functions appear in one of the .c/.h files used by the S-function anyway. In the MATLAB error message, their names are concatenated with an underscore sign ("_"). I don't know if it does matter. The error ends as follows:
ERROR: C:/PROGRA~1/Matlab/r2010b\extern\lib\win32\lcc\libut.lib C:/PROGRA~1/Matlab/r2010b\extern\lib\win32\lcc\libmx.lib C:/PROGRA~1/Matlab/r2010b\extern\lib\win32\lcc\libmat.lib C:/PROGRA~1/Matlab/r2010b\extern\lib\win32\lcc\libmwsl_fileio.lib
global_sfct.obj .text: undefined reference to '_EIU_Global_init'
global_sfct.obj .text: undefined reference to '_EIU_Global_reset'
global_sfct.obj .text: undefined reference to '_EIU_Global'
gmake: *** [../main_model.exe] Error 3
### Real-Time Workshop build procedure for model: 'main_model' aborted due to an error.

채택된 답변

MathWorks Support Team
MathWorks Support Team 2022년 10월 8일
편집: MathWorks Support Team 2022년 10월 8일
This error usually happens if Simulink cannot find the source files required by the S-function. Please check regarding the following:
- The sources files are in the same directory as the S-function source file.
- Specify these files names in the 'S-function modules' field. Enter the filenames only; do not use extensions or full pathnames, e.g., enter 'src src1', not 'src.c src1.c'.
For additional information for specifying additional source files, refer to the link below:

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

제품


릴리스

R2010b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by