error C2668 on Building model matlab2016b with veristand2018 C++ (SDK7.1)

2 ビュー (過去 30 日間)
alexandre colas
alexandre colas 2019 年 7 月 18 日
コメント済み: alexandre colas 2019 年 8 月 6 日
Hello,
i have a Build error when i try to build my engine model under Matlab 2016b withy Veristand 2018 in C++ ( Windows SDK 7.1) :
error C2668: 'pow' : ambiguous call to overloaded function
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(583): could be 'long double pow(long double,int)'
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(535): or 'float pow(float,int)'
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(497): or 'double pow(double,int)'
while trying to match the argument list '(int, int)'
how to correct this error ?

回答 (1 件)

Chidvi Modala
Chidvi Modala 2019 年 8 月 6 日
This error can occur because the pow(int, int) was removed from math.h in the CRT.
You can fix this by casting the first parameter to a suitable type (float/double/long double).
  1 件のコメント
alexandre colas
alexandre colas 2019 年 8 月 6 日
hello,
i try it but i always have this error.
it's possible that a complexe function use it but in this case i can not cast the first parameter...
slts

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

カテゴリ

Help Center および File ExchangeC Shared Library Integration についてさらに検索

製品


リリース

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by