ホーム » 2022 » 12月 » 21

日別アーカイブ: 2022/12/21

2022年12月
 123
45678910
11121314151617
18192021222324
25262728293031

カテゴリー

アーカイブ

ブログ統計情報

  • 80,090 アクセス



error C2668: ‘abs’

1>------ ビルド開始: プロジェクト: ClCpy, 構成: Debug Win32 ------
1>コンパイルしています...
1>ClCpyDlg.cpp
1>l:\document\develop\tools\_free\tiny\clcpy\clcpydlg.cpp(396) : error C2668: 'abs' : オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照)
1>        c:\program files (x86)\microsoft visual studio 8\vc\include\math.h(539): 'long double abs(long double)' の可能性があります。
1>        c:\program files (x86)\microsoft visual studio 8\vc\include\math.h(491): または 'float abs(float)'
1>        c:\program files (x86)\microsoft visual studio 8\vc\include\math.h(487): または 'double abs(double)'
1>        c:\program files (x86)\microsoft visual studio 8\vc\include\math.h(485): または 'long abs(long)'
1>        c:\program files (x86)\microsoft visual studio 8\vc\include\stdlib.h(415): または 'int abs(int)'
1>        引数リスト '(size_t)' を一致させようとしているとき
1>ビルド時間 0:07
1>ClCpy - エラー 1、警告 0
========== ビルド: 0 正常終了、1 失敗、0 更新、0 スキップ ==========

error C2668: 'abs' : オーバーロード関数の呼び出しを解決することができません。
次の様に long にキャストすることで対応.
size_t len_ = ::abs(long(lenS-lenD)) ;

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.