0

I wish to run a C Code in android for which I am using android ndk. I also need to add some libraries. While building these libraries, I am getting errors because of the extern statements in the header files. Eclipse IDE shows syntax errors. I also unchecked everything at Project-->Properties--> C/C++ Code Analysis.

Similar example is shown here. How to resolve this?

#ifdef __cplusplus
extern "C" {
#endif
re3el
  • 735
  • 2
  • 12
  • 28
  • The `extern "C"` should be used for method that will call throught jni, when building C++ code with the NDK. If you don't build C++ code, you should not use `extern "C"`. If you want to build C++ code, make sure you source file is `.cpp` and that you add the appropriate flag in `Android.mk`. Also where in your projet is the code example you show ? – sonic Oct 12 '15 at 12:38
  • did you close the brace? `#ifdef __cplusplus } #endif` – 18446744073709551615 Oct 12 '15 at 12:49

0 Answers0