は、私は次のヘッダーファイルのコンパイルエラーを取得しています: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
などjobject
へなど、他のJNI参照が、ありますが、JNIEnv
、JavaVM
、 のjni.h>ヘッダーが欠落しているとは言いません(それはありましたが、インクルードパスを追加することで簡単に修正できました)。私はヘッダーファイルをチェックしており、そのヘッダーには型が定義されています(そして< jni_md.h>)。
これは意味がありません。何か案は?
EDIT:次のエラーテキストを含めるのを忘れていました。
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
@stackoverflow.com/questions/7212982/ –
@ ZabojCampulaを参照してください。私はヘッダーを見つけることに問題がないと言いましたが、それらは含まれています。 –