java - Eclipse shows error, while ndk_build is sucessful -
this question has answer here:
i doing java native development android. , use android ndk , eclipse ide. write c/c++ code in jni , eclipse shows errors such as:
could not resolved:
- jniexport
- jnicall
- jnienv
- jobject
- jint
but on other hand ndk-build
builds .so file sucessfully without error or warnings. how fix in eclipse?
if need here code compile:
#include <jni.h> #include <unistd.h> int multiply(int i, int j) { int x = * j; return x; } extern "c" { jniexport jint jnicall java_cookbook_chapter3_hellondkgdbactivity_multiply(jnienv* env, jobject o, jint pi, jint pj){ int = 1, j = 0; while (i) { j=(++j)/100; } return multiply(pi, pj); } }
try refresh project tree. eclipse shows error, why when click on project , press f5
(refresh), errors gone. don't please try approach below:
turn off checks in project properties -> c/c++ general -> code analysis
see actual answer here: syntax error notification in native code in eclipse using newest ndk r8d
Comments
Post a Comment