android studio的NDK开发报错"cstdlib error: no member named 'XXX' in the global namespace"

ndk开发make project时候报错:

In file included from D:/AndroidStudio/Android/Sdk/ndk-bundle/platforms/android-15/arch-arm/usr/include\stdlib.h:43:

In file included from ../../../../../dmlc_for_android/src/main/dmlc/include\memory.h:11:

In file included from ../../../../../dmlc_for_android/src/main/dmlc/include/./logging.h:11:

D:/AndroidStudio/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include\cstdlib:119:11: error: no member named 'ldiv_t' in the global namespace; did you mean 'dev_t'?

  using ::ldiv_t;

仔细看了下发现stdlib.h的第43行包含了

#include 

但是错误却是引入的第三方库dmlc的头文件中出现了错误,发现原来包含了dmlc的头文件memory.h,而非标准库中的memory.h,然后把引入dmlc的头文件命令

include_directories(${DMLC_HOME}/src/main/dmlc/include)

从app下的CMakeLists.txt中注释掉就好了。

你可能感兴趣的:(android studio的NDK开发报错"cstdlib error: no member named 'XXX' in the global namespace")