Undefined reference to `ssFxpSetU32BitRegionCompliant' and `ssRegisterDataTypeFxpBinaryPoint'
2 次查看(过去 30 天)
显示 更早的评论
Hi,
I am trying to compile a MEX file from a set of C source code files from our project. In the output specification function of the S function, I have defined 64 bit output parameter.
I had created a legacy code C file which acts as a wrapper to the source code files and tried compiling it along with other source code files with the command mex src1.c src2.c, ..... etc..,
On compiling the mex file, I get Undefined reference to `ssFxpSetU32BitRegionCompliant' and Undefined reference to `ssRegisterDataTypeFxpBinaryPoint' errors.
I had inspected the legacy code generated C file and it already has the fixedpoint.h included which has the function definition for `ssFxpSetU32BitRegionCompliant' and `ssRegisterDataTypeFxpBinaryPoint'.
It is strange that there is error eventhough the fixedpoint.h file is included. I am using R2019b version.
Thanks
3 个评论
Danilo Teran
2022-7-22
Hi
could you solve it ? i have the same problem and dont know how to resolve it
thanks for your help =)
回答(1 个)
Narvik
2024-1-24
Hi,
As per my understanding, you are trying to compile a MEX file and facing issues. The errors you are seeing “Undefined reference to ssFxpSetU32BitRegionCompliant” and “Undefined reference to ssRegisterDataTypeFxpBinaryPoint” typically indicate a linking problem. In C and C++, an “undefined reference” error occurs when the linker is unable to find the implementation of a function or a symbol.
Since you mentioned that you included the fixedpoint.c and fixedpoint.h files in your S-function, you can try passing an extra argument “lfixedpoint” to the mex command. For example:
>> mex sfun_user_fxp_asr.c -lfixedpoint
The argument "-lfixedpoint" tells the MEX compiler to link against the fixedpoint library when creating the MEX-file. Refer to
matlabroot/toolbox/simulink/fixedandfloat/fxpdemos/mex_sfun_user_fxp_examples.m
file for more information on the same.
The following documentation provides more information on creating MEX files:
Hope this helps!
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!