Why do I get a compile error when generating code for an automatically generated S-Function?

I am running into an error while generating code for an S-Function that I have previously build via the right-click menu 'C/C++ Code > Generate S-Function', based on a Simulink model I created. The error specifically mentions:
_Subsystem_sf.obj : error LNK2019: unresolved external symbol ssFxpSetU32BitRegionCompliant referenced in function mdlInitializeSizes
..\untitled.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'
Stop._
I want to make sure that the file 'ssFxpSetU32BitRegionCompliant', mentioned in the error, is included in the build.

 채택된 답변

Two possible workaround exist for the issue at hand:
  1. If you need to generate a Windows executable, please add the output of the following command to 'Configuration Parameters > Code Generation > Custom Code > Additional build information: Libraries' of the S-Function model:* >> fullfile(matlabroot,'extern\lib\win64\microsoft\libfixedpoint.lib')
  2. If you need to generate code for a specific target, please open the file '<MODELNAME>_sf.c' file in the '<MODELNAME>_sfcn_rtw' folder, and add the following statements before and after the 'ssFxpSetU32BitRegionCompliant(S, 1);' line:* Before: #if defined (MATLAB_MEX_FILE)* After: #endif

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Simulink Coder에 대해 자세히 알아보기

제품

릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by