필터 지우기
필터 지우기

Undefined reference to `ssFxpSetU​32BitRegio​nCompliant​' and `ssRegiste​rDataTypeF​xpBinaryPo​int'

조회 수: 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
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 =)
Arvindh Ram Ganapathi Raman
Arvindh Ram Ganapathi Raman 2022년 7월 22일
I couldn't solve it directly, I worked around by splitting 64 bit variables into 2 32 bit variables and working with that. Sadly I could find no help regarding this on the internet. Let me know if you solved it the right way somehow.

댓글을 달려면 로그인하십시오.

답변 (1개)

Narvik
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!

카테고리

Help CenterFile Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by