The type "JNICALL" cannot be resolved?

I am trying to use NDK in eclipse but following the instructions this error appears and I donโ€™t understand where it comes from

this is my .h file

/* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> /* Header for class com_example_myproject_MainActivity */ #ifndef _Included_com_example_myproject_MainActivity #define _Included_com_example_myproject_MainActivity #ifdef __cplusplus extern "C" { #endif /* * Class: com_example_myproject_MainActivity * Method: getMyData * Signature: ()Ljava/lang/String; */ JNIEXPORT jstring JNICALL Java_com_example_myproject_MainActivity_getMyData (JNIEnv *, jobject); #ifdef __cplusplus } #endif #endif 

Error = type "JNICALL" cannot be resolved

I also have syntax errors in the code view, but they do not appear between errors that they appear with JNIEXPORT

+4
source share
3 answers

For the most part, JNICALL is used in windows. I'm 99% sure you can add

#define JNICALL

(define it as a space)

Same thing with JNIEXPORT.

+2
source

Go to Project Properties -> C / C ++ General-> Paths and Symbols.

  • Select the Enable tab and click the Add button on the right side of the window.
  • Select include directory from file system

For example: C: \ Program Files (x86) \ Android \ android-sdk \ NDK \ android-ndk-r10 \ platform \ android-L \ arch-arm \ usr \ include.

He will ask you if you want to rebuild, click "Yes" ... "Finish"

+1
source

I just ran into this problem, here is my solution. If you worked on Linux with Java 7 , make sure that these two include the paths to you. Includes

 /usr/lib64/jvm/java-7-oracle/include/linux /usr/lib64/jvm/java-7-oracle/include 
0
source

All Articles