필터 지우기
필터 지우기

Simulink Compiler - Max block not finding fmax?

조회 수: 18 (최근 30일)
B. J.
B. J. 2011년 6월 21일
Hi Everyone,
I am running 2011a discrete fixed-sized solver. I am trying to compile a target file of ert.tlc for C++.
I get the error TestMax.cpp TestMax.cpp(38) : error C3861: 'fmax': identifier not found NMAKE : fatal error U1077: '"D:\Program Files\VC\bin\cl.EXE"' : return code '0x2' Stop. The make command returned an error of 2 'An_error_occurred_during_the_call_to_make' is not recognized as an internal or external command, operable program or batch file. ### Build procedure for model: 'TestMax' aborted due to an error.}
Relating to the proper .cpp file, it is this:
33 /* Outport: '<Root>/Out1' incorporates:
34 * Constant: '<Root>/Constant5'
35 * DiscreteTransferFcn: '<Root>/Discrete Transfer Fcn'
36 * MinMax: '<Root>/MinMax1'
37 */
38 TestMax_Y.Out1 = fmax(0.0198 * TestMax_DWork.DiscreteTransferFcn_DSTATE, 2.0);
I have a max block selecting the output of a discrete tf and a constant. I can probably reconfigure it with a switch case, but I want to know why it is not working. I have been using the model adviser to no errors.
thanks in advance, B.
  댓글 수: 1
B. J.
B. J. 2011년 6월 21일
Hi Kaustubha,
In my code generation interface I have my target function defined as C++ (ISO). Changing it to C89/C90 did work! Thanks!

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

채택된 답변

Kaustubha Govind
Kaustubha Govind 2011년 6월 21일
Do you have C99 (ISO) selected as the Target function library in the Code Generation > Interface pane of your Configuration Parameters window? If yes, it is likely that your version of Visual Studio does not support the C99 standard. Switch to the default "C89/C90 (ANSI)" target function library and see if you are able to build the model.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Compiler에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by