Undefined reference error when building RTW model reference with embedded matlab function blocks.

조회 수: 1 (최근 30일)
I have a model which references several other models. I can build each of the referenced models individually without issue. When I try to build the top level model I get several errors like this :
ref_model.c:(.text+0xae6): undefined reference to 'pow'
It fails to find pow, cos, sin, sqrt functions.This error only appears in referenced model that contain embedded matlab functions. I have other referenced models in my system that contain only default Simulink blocks and they do not have this error. The error message points to the issue arising from mr_ref_model declaration in the C code for my top level model. I attempted to add declare the libraries that include these functions in he code for each of the referenced models but that won't help. The folders of each model are in the same directory as my top level model. What else can I try?I am using matlab 2007b.
  댓글 수: 1
Nigel Stuart
Nigel Stuart 2016년 9월 22일
편집: Nigel Stuart 2016년 9월 23일
Although the error is almost identical to mine, changing the configuration parameters does not help in my case.
I created a new model and only referenced one of my other models as a test case. The same error occurs :
Sample_ref_model_rtwlib.a(Sample_ref_model.o): In function `mr_Sample_ref_model':
Sample_ref_model.c:(.text+0x78): undefined reference to `cos'
Sample_ref_model.c:(.text+0xe6): undefined reference to `cos'
Sample_ref_model.c:(.text+0x1b7): undefined reference to `cos'
Sample_ref_model.c:(.text+0x20a): undefined reference to `cos'
Sample_ref_model.c:(.text+0x32f): undefined reference to `ceil'
I must be missing a step or something.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Schedule Model Components에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by