使用新的 Visual Studio 2015 预览版创建原生 Android NDK 项目并将 STL 更改为“LLVM libc++ 静态库 (c++_static)”时,只需包含<cmath>
在默认的“main.cpp”文件中并使用默认的 Clang 3.4 进行编译导致以下问题:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Apps\android-ndk-r10\sources\cxx-stl\llvm-libc++\libcxx\include\cmath(652,8): error : no member named 'float_t' in the global namespace
1> using ::float_t;
1> ~~^
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\Apps\android-ndk-r10\sources\cxx-stl\llvm-libc++\libcxx\include\cmath(653,8): error : no member named 'double_t' in the global namespace
1> using ::double_t;
1> ~~^
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\Apps\android-ndk-r10\sources\cxx-stl\llvm-libc++\libcxx\include\cmath(680,85): error : use of undeclared identifier 'acosl'
1> inline _LIBCPP_INLINE_VISIBILITY long double acos(long double __x) _NOEXCEPT {return acosl(__x);}
...和更多。
这在使用 Eclipse 时从来没有引起过问题,所以我不确定我做错了什么或者默认项目是否有问题?
编辑:现在我已经向 Microsoft Connect 添加了一个错误修复票: