8

I have an Android project setup in Eclipse which uses the JNI to access C code, and everything does work fine until I open one of the C files. Once that's done I get these errors:


enter image description here


I have tried quite a bit of things, including this:

Surprise behavior of eclipse for C files while using JNI, Why so?

My NDK path is also set like so:

enter image description here

Has anyone got a solution to this? Please note that closing the project and reopening makes the problem go away but once you open a C source file the problem appears again. Also note, that the project compiles, runs and makes use of the JNI wrapper and underlying C source just fine if I do not open a C file.

EDIT:

When hovering towards the explicit red bugs I get messages like Type jstring could not be resolved. I kind of understand what the problem might be, what I don't understand is that why is this a problem only when I open the source file? And why, If i don't open the file in the editor, this works perfectly?

EDIT 2:

I forgot to mention that I am doing this on a mac.

Community
  • 1
  • 1
Arsalan Habib
  • 1,395
  • 14
  • 20

3 Answers3

3

Eclipse compiles successfully but still gives semantic errors In your selected project preferences within the Eclipse environment, go to C/C++ General -> Code Analysis -> Launching. Make sure that both check boxes are unchecked.

Community
  • 1
  • 1
0

I know it's old question. But update you CDT and everything will work fine.

mthakuri
  • 1,085
  • 8
  • 13
0

Also for anyone that might have this error, make sure that in C/C++ General -> Code Analysis, the option Syntax and Semantic Errors is unchecked:

enter image description here

Dielson Sales
  • 1,715
  • 1
  • 20
  • 25