0

i want to parse xml by rapidxml(on android devices, NDK). but when i include the rapidxml.hpp in my cpp file, and compile it. the compilor shows me that "jni/rapidxml.hpp:11:47: fatal error: cstdlib: No such file or directory". what's wrong with it?

the code and compile result followed.

source code:

#include "rapidxml_utils.hpp"

void test(){}

compile result:

jni/rapidxml.hpp:11:47: fatal error: cstdlib: No such file or directory compilation terminated. make: * [obj/local/armeabi/objs/rapidxml/RapidXml.cpp,rapidxml.o] Error 1

joyDream
  • 27
  • 5

1 Answers1

0

You should also include the header file in your Android.mk using LOCAL_C_INCLUDES in your module.

eozgonul
  • 810
  • 6
  • 12
  • The problem still exist after i add "LOCAL_C_INCLUDES := sources/cxx-stl/gnu-libstdc++/4.7/include/" to Android.mk. something else i have missed? – joyDream Sep 02 '13 at 04:12
  • Do you include rapidxml_utils.hpp in your module? – eozgonul Sep 02 '13 at 10:31
  • I have include rapidxml_utils.hpp. Now I set "LOCAL_C_INCLUDES := $(ANDROID_NDK_PATH)/sources/cxx-stl/gnu-libstdc++/4.7/include/", then it can find cstdlib. But it failed to find "bits/c++config.h" in cstdlib instead. I cant find the c++config.h in the same directory. the file appear in other directory such as "cxx-stl/gnu-libstdc++/4.7/libs/x86/include/bits/c++config.h". – joyDream Sep 03 '13 at 01:54
  • Do you have APP_STL := gnustl_static or APP_STL := stlport_static line in your Application.mk? You should not add those headers one by one. – eozgonul Sep 03 '13 at 05:43