title: 'NULL' undeclared (first use in this function) using android ndk
body: <p>I am working on android-ndk in which i try to pass string from my C code to my java and then in activity. My codes are given below but i am getting the following errors. Please help me out here</p>
  
  <pre><code>#include &lt;com_testing_ndk_FibLib.h&gt;
  
  JNIEXPORT jstring JNICALL Java_Sample1_stringMethod(JNIEnv *env, jobject obj,
          jstring string) {
  
      const char *name = (*env)-&gt;GetStringUTFChars(string, NULL); //Java String to C Style string
      char msg[60] = "HelloWorld";
      jstring result;
  
      strcat(msg, name);
      (*env)-&gt;ReleaseStringUTFChars(string, name);
      puts(msg);
      result = (*env)-&gt;NewStringUTF(msg); // C style string to Java String
      return result;
  }
  </code></pre>
  
  <p>Error log:</p>
  
  <pre><code>jni/com_testing_ndk_FibLib.c: In function 'Java_Sample1_stringMethod':
  jni/com_testing_ndk_FibLib.c:7:55: error: 'NULL' undeclared (first use in this function)
    const char *name = (*env)-&gt;GetStringUTFChars(string, NULL); //Java String to C Style string
                                                         ^
  jni/com_testing_ndk_FibLib.c:7:55: note: each undeclared identifier is reported only once for each function it appears in
  jni/com_testing_ndk_FibLib.c:7:21: error: too few arguments to function '(*env)-&gt;GetStringUTFChars'
    const char *name = (*env)-&gt;GetStringUTFChars(string, NULL); //Java String to C Style string
                       ^
  jni/com_testing_ndk_FibLib.c:11:2: warning: incompatible implicit declaration of built-in function 'strcat'
    strcat(msg, name);
    ^
  jni/com_testing_ndk_FibLib.c:12:2: warning: passing argument 2 of '(*env)-&gt;ReleaseStringUTFChars' discards 'const' qualifier from pointer target type
    (*env)-&gt;ReleaseStringUTFChars(string, name);
    ^
  jni/com_testing_ndk_FibLib.c:12:2: note: expected 'jstring' but argument is of type 'const char *'
  jni/com_testing_ndk_FibLib.c:12:2: error: too few arguments to function '(*env)-&gt;ReleaseStringUTFChars'
  jni/com_testing_ndk_FibLib.c:14:11: warning: passing argument 1 of '(*env)-&gt;NewStringUTF' from incompatible pointer type
    result = (*env)-&gt;NewStringUTF(msg); // C style string to Java String
             ^
  jni/com_testing_ndk_FibLib.c:14:11: note: expected 'const struct JNINativeInterface **' but argument is of type 'char *'
  jni/com_testing_ndk_FibLib.c:14:11: error: too few arguments to function '(*env)-&gt;NewStringUTF'
  make: *** [obj/local/arm64-v8a/objs/com_testing_ndk_FibLib/com_testing_ndk_FibLib.o] Error 1
  </code></pre>
  
  <p>My Java Code:</p>
  
  <pre><code>public class FibLib {
  
      static {
          System.loadLibrary("com_testing_ndk_FibLib");
      }
  
  
  
       public static native String stringMethod(String text);
  
          public static void main(String[] args)
          {
             System.loadLibrary("Sample1");
             FibLib sample = new FibLib();
  
             String  text   = sample.stringMethod("world");
  
             System.out.println("stringMethod: " + text);    
         }
  }
  </code></pre>