Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/234.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android-NDK奇怪错误_Android_Android Ndk - Fatal编程技术网

Android-NDK奇怪错误

Android-NDK奇怪错误,android,android-ndk,Android,Android Ndk,我开始用NDK和相当复杂的程序出现有趣的错误: #include <stdio.h> #include <iostream> int main( int argc, char **argv ) { return 0; } >call c:\android-ndk-r9\ndk-build.cmd "Compile++ thumb : test <= test.cpp In file included from C:/workspace/c++11

我开始用NDK和相当复杂的程序出现有趣的错误:

#include <stdio.h>
#include <iostream>

int main( int argc, char **argv ) {
    return 0;
}


>call c:\android-ndk-r9\ndk-build.cmd
"Compile++ thumb : test <= test.cpp
In file included from C:/workspace/c++11_test//jni/test.cpp:11:
In file included from c:/android-ndk-r9/sources/cxx-stl/stlport/stlport\iostream:43:
In file included from c:/android-ndk-r9/sources/cxx-stl/stlport/stlport\stl/_istream.h:31:
In file included from c:/android-ndk-r9/sources/cxx-stl/stlport/stlport\stl/_ostream.h:380:
In file included from c:/android-ndk-r9/sources/cxx-stl/stlport/stlport\stl/_ostream.c:26:
In file included from c:/android-ndk-r9/sources/cxx-stl/stlport/stlport\stl/_num_put.h:180:
In file included from c:/android-ndk-r9/sources/cxx-stl/stlport/stlport\stl/_num_put.c:26:
c:/android-ndk-r9/sources/cxx-stl/stlport/stlport\stl/_limits.h:217:48: error: non-type template argument evaluates to -2147483648, which cannot be narrowed to type 'wchar_t'
      [-Wc++11-narrowing]
  : public _STLP_PRIV _Integer_limits<wchar_t, WCHAR_MIN, WCHAR_MAX, -1, true>
                                               ^
c:/android-ndk-r9/platforms/android-14/arch-arm/usr/include\../include/wchar.h:76:22: note: expanded from macro 'WCHAR_MIN'
#define  WCHAR_MIN   INT_MIN
                     ^
c:/android-ndk-r9/platforms/android-14/arch-arm/usr/include\sys/limits.h:69:18: note: expanded from macro 'INT_MIN'
#define INT_MIN         (-0x7fffffff-1) /* min value for an int */
                        ^
1 error generated.
#包括
#包括
int main(int argc,字符**argv){
返回0;
}
>调用c:\android-ndk-r9\ndk-build.cmd

“编译++拇指:测试您似乎启用了C++11,因为您收到了此警告

对C++11的STLport支持不是很好。我怀疑这就是你的问题所在

修复需要更改STLport,或者从clang命令行中删除“-std=c++11”开关

IMHO,我建议切换到gnustl(又名libstdc++),除非有其他原因阻止您这样做(许可:libstdc++可能对clang有效,也可能对clang无效-您应该自己确定)、遗留支持、大小等)。我在这方面有很好的经验