私は emscripten を使用する初心者で、cpp ファイルのコンパイル中にエラーが発生しました。
私はiae.cppを持っています:
bool IsAlmostEqual(double A, double B)
{
//http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm
long long aInt = reinterpret_cast<long long&>(A);
if (aInt < 0) aInt = -9223372036854775808LL - aInt;
long long bInt = reinterpret_cast<long long&>(B);
if (bInt < 0) bInt = -9223372036854775808LL - bInt;
return (std::abs(aInt - bInt) <= 10000);
}
emscripten を使用してコンパイルしようとしました:
emcc iae.cpp
ただし、次の警告とエラーが生成されます。
INFO root: (Emscripten: Running sanity checks)
WARNING root: java does not seem to exist, required for closure compiler. -O2 and above will fail. You need to define JAVA in ~/.emscripten
iae.cpp:5:27: warning: integer constant is so large that it is unsigned
if (aInt < 0) aInt = -9223372036854775808LL - aInt;
^
iae.cpp:7:27: warning: integer constant is so large that it is unsigned
if (bInt < 0) bInt = -9223372036854775808LL - bInt;
^
iae.cpp:8:13: error: use of undeclared identifier 'std'
return (std::abs(aInt - bInt) <= 10000);
^
2 warnings and 1 error generated.
ERROR root: compiler frontend failed to generate LLVM bitcode, halting
これらの警告とエラーを取り除く方法と、IsAlmostEqual()
emscripten を使用してコンパイルすることさえ可能ですか?