Why do I receive linker errors when compiling a fixed-point Simulink S-functions?
Show older comments
I wrote a fixed-point S-function that uses functions from the Fixed-Point S-Function API, such as:
- ssRegisterDataTypeFxpBinaryPoint
- ssRegisterDataTypeFxpSlopeBias
- ssRegisterDataTypeHalfPrecision
- ssRegisterDataTypeFxpScaledDouble
- ssRegisterDataTypeFxpFSlopeFixExpBias
- ssFxpSetU32BitRegionCompliant
- ssFxpGetU32BitRegionCompliant
- ssFxpSetU32BitRegion
- ssFxpGetU32BitRegion
When I compile the S-function using MEX, I receive the following error:
ERROR: >> mex sfun_user_fxp_asr.c
Building with 'Microsoft Visual C++ 2022 (C)'.
Error using mex
Creating library sfun_user_fxp_asr.lib and object sfun_user_fxp_asr.exp
sfun_user_fxp_asr.obj : error LNK2019: unresolved external symbol ssRegisterDataTypeFxpBinaryPoint referenced in function mdlSetInputPortDataType
sfun_user_fxp_asr.obj : error LNK2019: unresolved external symbol ssGetDataTypeIsFxpFltApiCompat referenced in function isDataTypeSupported
sfun_user_fxp_asr.obj : error LNK2019: unresolved external symbol ssGetDataTypeStorageContainCat referenced in function isDataTypeSupported
sfun_user_fxp_asr.obj : error LNK2019: unresolved external symbol ssGetDataTypeFxpWordLength referenced in function mdlSetInputPortDataType
sfun_user_fxp_asr.obj : error LNK2019: unresolved external symbol ssGetDataTypeFxpIsSigned referenced in function mdlSetInputPortDataType
sfun_user_fxp_asr.obj : error LNK2019: unresolved external symbol ssGetDataTypeIsScalingPow2 referenced infunction isDataTypeSupported
sfun_user_fxp_asr.obj : error LNK2019: unresolved external symbol ssGetDataTypeFractionLength referenced in function mdlSetInputPortDataType
sfun_user_fxp_asr.mexw64 : fatal error LNK1120: 7 unresolved externals
Accepted Answer
More Answers (0)
Categories
Find more on Integrate External Code in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!