Why do I get a compile error with my S-Function Builder generated S-Function with the Simulink Coder?
14 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2014 年 4 月 1 日
編集済み: MathWorks Support Team
2019 年 2 月 28 日
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
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 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!