Why do I get a compile error with my S-Function Builder generated S-Function with the Simulink Coder?

조회 수: 14 (최근 30일)
I have a Simulink model containing an S-Function that has been generated with the S-Function Builder.
I am trying to compile this model with the Simulink Coder.
The build throws the following error:
testsfun2.obj : error LNK2019: unresolved external symbol test1_Outputs_wrapper referenced in function testsfun2_step
..\testsfun2.exe : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\link.EXE"' : return code '0x460'

채택된 답변

MathWorks Support Team
MathWorks Support Team 2019년 2월 28일
The error message shows that the file 'test1_wrapper.c' cannot be found by the compiler.
This file is generated by the S-Function Builder and contains C-code that is called by the S-Function. The S-Function Builder automatically includes this wrapper file in the compilation of the generated code.
However, in your case, you are trying to use a simple S-Function block to call this S-Function. This block does not “know” that there is a wrapper file somewhere.
You need manually to add this C-file as additional source file in the configuration parameters under “Code Generation->Custom Code” in order to compile this model.

추가 답변 (0개)

카테고리

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

제품


릴리스

R2012b

Community Treasure Hunt

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

Start Hunting!

Translated by