Microsoft SDK 7 does nt recognize fmax and fmin functions from math.h header

1 回表示 (過去 30 日間)
hello everyone im trying to use mex command to compile c code but it show me erros like that
LNK2019 unresolved external symbol fmin
in the c code there are some other functions from math.h are working but fmin fmax doesnt
any help please thanks in advance

採用された回答

Walter Roberson
Walter Roberson 2019 年 5 月 18 日
Sdk7.1 was 2010 timeframe and did not support C99 and in particular did not support those functions.
https://social.msdn.microsoft.com/Forums/vstudio/en-US/cec84cf0-1b6b-44c0-aa7b-8c74be602d77/where-the-is-fmax-?forum=vclanguage
  2 件のコメント
SAID ELMOTAOUAKKEL
SAID ELMOTAOUAKKEL 2019 年 5 月 20 日
Thanks Walter but the C code is generated automatically with Simulink Coder with C89/C90 in standard math library target so it should'nt generate functions from C99 standard, do you have any idea please.
Walter Roberson
Walter Roberson 2019 年 5 月 20 日
編集済み: Walter Roberson 2019 年 5 月 22 日
fmin and fmax did not exist for c89 so with that target they should not be generated, at least not unless it provides its own definition. Might be a bug in the code generation phase. Not really a Sdk7.1 bug because with that target no call to them should have been created.
In the meantime you will probably need to supply your own definition for them. Should be very straightforward unless you need to handle nan

サインインしてコメントする。

その他の回答 (1 件)

SAID ELMOTAOUAKKEL
SAID ELMOTAOUAKKEL 2019 年 5 月 22 日
okey thanks a lot walter

カテゴリ

Help Center および File ExchangeSimulink Coder についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by