title: C++ compilation error for JNI: unknown type name JNIEnv jint JavaVM
body: <p>I'm getting a compilation error for the following header file:</p>
  
  <pre><code>#include &lt;jni.h&gt;
  
  #ifdef __cplusplus
  extern "C" {
  #endif
  
  typedef struct {
      jint x1;
      jint y1;
      jint x2;
      jint y2;
  } Bounds;
  
  ...
  
  #ifdef __cplusplus
  };
  #endif
  </code></pre>
  
  <p>There are other JNI references, such as to <code>jobject</code>, <code>JNIEnv</code>, <code>JavaVM</code>, etc.
  It's not complaining that the &lt;jni.h> header is missing (it was, but that was easily fixed by adding the include path). I've checked the header file and the types are defined in that header (and &lt;jni_md.h> too).</p>
  
  <p>This isn't making any sense to me. Any ideas?</p>
  
  <p>EDIT: I forgot to include the following error text.</p>
  
  <pre><code>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;
      ^
  </code></pre>