title: jni compile with cl compiler has syntax error, but not relevant
body: <p>I am trying to use JNI in Windows 7 64 bit.
  Below is my steps.</p>
  
  <p>Step 1. 
  open new Java Application project in eclipse Kepler 4.3.</p>
  
  <p>Step 2.
  make a Java Class named "HelloWorld".
  code is </p>
  
  <pre><code>public class HelloWorld {
      private static String lib_path = "C:\\Users\\thanks\\workspace\\Hello\\src\\";
      private static String lib_file = "hello.dll";
      String greeting = "Hello, Java World!";
      public native void display();
      public static void main(String[] args) {
          HelloWorld hw = new HelloWorld();
          System.out.println(hw.greeting);
          hw.display();
          System.out.println(hw.greeting);
      }
  
      static{
          System.load(lib_path + lib_file);
      }
  };
  </code></pre>
  
  <p>Step 3. do 'javac' and 'javah' command in 'VS2013 dev command prompt'.
  Actual command is below.</p>
  
  <pre><code>javac HelloWorld.java
  javah -jni HelloWorld 
  </code></pre>
  
  <p>Step 4. Now I got HelloWorld.java, HelloWorld.class, HelloWorld.h. So make a 'C' file named 'HelloWorld.c'. code is here.</p>
  
  <pre><code>#include "HelloWorld.h"
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  
  JNIEXPORT void JNICALL JAVA_HelloWorld_display(JNIENV* env, jobject jobj){
  
      jfieldID fldid;
      jstring greeting;
      const char* tmp;
  
      jclass instance = (*env)-&gt;GetObjectClass(env, jobj);
      fprintf(stderr, "Start C Implementation.\n");
  
      if(jobj == NULL){
          fprintf(stderr, "Input pointer is null.\n");
          return;
      }
  
      fldid = (*env)-&gt;GetFieldID(env, instance, "greeting", "Ljava/lang/String;");
  
      if(fldid == NULL){
          fprintf(stderr, "Failed to get field ID.\n");
          return;
      }
  
      greeting = (*env)-&gt;GetObjectField(env, jobj, fldid);
      tmp = (*env)-&gt;GetStringUTFChars(env, greeting, NULL);
  
      printf("%s\n", tmp);
      greeting = NewStringUTF(env, "Hello C World");
  
      if(greeting == NULL){
          printf("Out of Memory.\n");
          return;
      }
  
      (*env)SetObjectField(env, jobj, fldid, greeting);
      printf("End of C impelementation.\n");
      return;
  }
  </code></pre>
  
  <p>As you can see no syntax error here.</p>
  
  <p>Step 4. now I compile with 'cl' compiler. command is</p>
  
  <pre><code>cl HelloWorld.c -Fehello.dll -MD -LD
  </code></pre>
  
  <p>Problem occurs in Step 4. When I try that command, it shows weird syntax errors.
  (I do not know why Windows command window does not allow dragging. So I just post error codes. But all messages are pointing syntax errors that actually does not exist.)</p>
  
  <p>ErrorCode :
  C2143 - bracket.
  C2040 - reference level.
  C2146 - can not find ';'.
  C2059 - can not find '('.
  C2054 - can not find ')'.</p>
  
  <p>Thanks for reading and sharing my errors:D</p>