title: Cannot use .c file in Android NDK project
body: <p>If I have my Android NDK project use a .c file instead of .cpp I cannot resolve any functions inside JNIEnv*. Here is how I'm trying to use it:</p>
  
  <pre><code>(*env)-&gt;GetCharArrayElements(chrs, 0);
  </code></pre>
  
  <p>I have also tried:</p>
  
  <pre><code>GetCharArrayElements(env, chrs, 0);
  env-&gt;GetCharArrayElements(chrs, 0);
  </code></pre>
  
  <p>This is getting frustrating as I have some c library projects that I would like to include but if I have .cpp file then the library will need to be ported somehow and I would like to avoid that. Any help/ideas would be great.</p>
  
  <p>Here is my Android.mk:</p>
  
  <pre><code>LOCAL_PATH := $(call my-dir)
  
  include $(CLEAR_VARS)
  
  LOCAL_MODULE    := NDKDemo
  LOCAL_SRC_FILES := NDKDemo.c
  
  include $(BUILD_SHARED_LIBRARY)
  </code></pre>
  
  <p><strong>edit:</strong></p>
  
  <p>Here is how I'm declaring JNIEnv*</p>
  
  <pre><code>#include &lt;jni.h&gt;
  JNIEXPORT void JNICALL Java_com_atd_ndkdemo_NDKDemo_charManip(JNIEnv* env, jobject obj, jcharArray chrs) 
  
      jchar* cchar0 = GetCharArrayElements(chrs, 0);
      jchar* cchar1 = (*env)-&gt;GetCharArrayElements(env, chrs, 0);
      jchar* cchar2 = (*env)-&gt;GetCharArrayElements(chrs, 0);
      jchar* cchar3 = env-&gt;GetCharArrayElements(chrs, 0);
  }
  </code></pre>
  
  <p>Interestingly, <strong>cchar0</strong> doesn't complain until I try to compile, then eclipse tells me it cannot be resolved again.</p>