本机cpp中有很多未解决的错误

时间:2014-02-25 12:31:34

标签: android c++ eclipse android-ndk java-native-interface

我已经将一个项目导入我的工作区,以前它工作正常,但是现在我打开我的cpp文件后就开始给我错误xyz could not be resolved,其中xyz可能是任何字段或方法,这里是问题日志。

Field 'vm' could not be resolved    android_tools.cpp   /ImageTargets/jni   line 112    Semantic Error
Method 'DetachCurrentThread' could not be resolved  android_tools.cpp   /ImageTargets/jni   line 112    Semantic Error
Method 'DetachCurrentThread' could not be resolved  android_tools.cpp   /ImageTargets/jni   line 83 Semantic Error
Field 'activity' could not be resolved  android_tools.cpp   /ImageTargets/jni   line 112    Semantic Error
Method 'DetachCurrentThread' could not be resolved  android_tools.cpp   /ImageTargets/jni   line 71 Semantic Error
Field 'activity' could not be resolved  android_tools.cpp   /ImageTargets/jni   line 77 Semantic Error
Field 'activity' could not be resolved  android_tools.cpp   /ImageTargets/jni   line 71 Semantic Error
Field 'vm' could not be resolved    android_tools.cpp   /ImageTargets/jni   line 71 Semantic Error
Field 'activity' could not be resolved  android_tools.cpp   /ImageTargets/jni   line 83 Semantic Error
Field 'vm' could not be resolved    android_tools.cpp   /ImageTargets/jni   line 83 Semantic Error
Field 'vm' could not be resolved    android_tools.cpp   /ImageTargets/jni   line 77 Semantic Error
Method 'DetachCurrentThread' could not be resolved  android_tools.cpp   /ImageTargets/jni   line 77 Semantic Error
Method 'DetachCurrentThread' could not be resolved  android_tools.cpp   /ImageTargets/jni   line 34 Semantic Error
Field 'vm' could not be resolved    android_tools.cpp   /ImageTargets/jni   line 34 Semantic Error
Field 'vm' could not be resolved    android_tools.cpp   /ImageTargets/jni   line 59 Semantic Error
Field 'activity' could not be resolved  android_tools.cpp   /ImageTargets/jni   line 59 Semantic Error
Invalid arguments '
Candidates are:
_jobject * CallObjectMethod(_jobject *, _jmethodID *, ...)
'   android_tools.cpp   /ImageTargets/jni   line 67 Semantic Error
Method 'DetachCurrentThread' could not be resolved  android_tools.cpp   /ImageTargets/jni   line 59 Semantic Error
Field 'clazz' could not be resolved android_tools.cpp   /ImageTargets/jni   line 67 Semantic Error
Field 'activity' could not be resolved  android_tools.cpp   /ImageTargets/jni   line 67 Semantic Error
Field 'activity' could not be resolved  android_tools.cpp   /ImageTargets/jni   line 17 Semantic Error
Field 'vm' could not be resolved    android_tools.cpp   /ImageTargets/jni   line 17 Semantic Error
Field 'activity' could not be resolved  android_tools.cpp   /ImageTargets/jni   line 17 Semantic Error
Field 'vm' could not be resolved    android_tools.cpp   /ImageTargets/jni   line 21 Semantic Error
Field 'activity' could not be resolved  android_tools.cpp   /ImageTargets/jni   line 21 Semantic Error
Field 'activity' could not be resolved  android_tools.cpp   /ImageTargets/jni   line 34 Semantic Error
Method 'AttachCurrentThread' could not be resolved  android_tools.cpp   /ImageTargets/jni   line 21 Semantic Error

由于这个问题,我无法在jni中打开我的cpp文件,我试图建立索引,但它没有用。如果我重新启动我的eclipse我的所有错误都已消失,如果我编译everthing工作正常并且项目在设备上运行但问题开始时我试图打开我的cpp文件它开始给我这种错误。

1 个答案:

答案 0 :(得分:2)

右键点击项目 - >属性 - > C / C ++一般 - >代码分析 - >启动

取消选中,申请,你应该很高兴。

可在此处找到相同的答案:Eclipse compiles successfully but still gives semantic errors