我得到一个编译错误的下面的头文件:C++为JNI编译错误:未知类型名称的JNIEnv jint JavaVM的
#include <jni.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
jint x1;
jint y1;
jint x2;
jint y2;
} Bounds;
...
#ifdef __cplusplus
};
#endif
还有其他的JNI引用,如jobject
,JNIEnv
,JavaVM
,等 这并不是抱怨,< jni.h头缺失(这是,但很容易通过添加包含路径修复)。我已经检查过头文件,并在头文件中定义了类型(也是< jni_md.h>)。
这对我没有任何意义。有任何想法吗?
编辑:我忘了包括以下错误文本。
g++ -O2 -fPIC -fpermissive -I. -I.. -I/usr/include -I/usr/local/include/libavcodec -I/usr/local/include/libavdevice -I/usr/local/include/libavformat -I/usr/local/include/libswscale -I/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers -DUNIX -shared -c -o Plugin.o Plugin.cpp
clang: warning: argument unused during compilation: '-shared'
In file included from Plugin.cpp:19:
In file included from Plugin.h:16:
Data.h:24:5: error: unknown type name 'jint'
jint x1;
^
Data.h:25:5: error: unknown type name 'jint'
jint y1;
^
Data.h:26:5: error: unknown type name 'jint'
jint x2;
^
Data.h:27:5: error: unknown type name 'jint'
jint y2;
^
请您提供完整的错误文字吗? – Leon
可能 - 请参阅http://stackoverflow.com/questions/7212982/ –
@ZabojCampula就像我说的,我没有找到标题的问题,他们被包括在内。 –