From: mikel AT super DOT hot DOT co DOT jp (MIKEL) Subject: How Can I Create Java-Native-Method? 22 Mar 1998 05:13:31 -0800 Message-ID: <01bd5306$78cf4280$06eba8c0.cygnus.gnu-win32@U-NETSURF> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_005B_01BD5351.E8B6EA80" To: This is a multi-part message in MIME format. ------=_NextPart_000_005B_01BD5351.E8B6EA80 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit Dear, I'm trying to integrate native code with Java programs. I implemented four steps as follows Step 1: Write th Java Code Step 2: Compile the Java Code Step 3: Create the .h File Step 4: Write the Native Method Implementation Step 5: Create a Shared Library But at Step 5, I cannot create a Shared Library. When I compile with "gcc -c HelloWorldImp.c", many parse error appears. parse error before `jlong' parse error before `*' parse error before `}' parse error before `_declspecs' and so on #include #include "HelloWorld.h" #include JNIEXPORT void JNICALL Java_HelloWorld_displayHelloWorld(JNIEnv *env, jobject obj) { printf("Hello world!\n"); return; } ------=_NextPart_000_005B_01BD5351.E8B6EA80 Content-Type: text/html; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable
Dear,
 
    I'm trying to = integrate=20 native code with Java programs.
    I implemented = four steps as=20 follows
 
       = Step 1:=20 Write th Java Code
       = Step 2:=20 Compile the Java Code
       = Step 3:=20 Create the .h File
       = Step 4:=20 Write the Native Method Implementation
       = Step 5:=20 Create a Shared Library
 
   But at Step 5, I cannot = create a=20 Shared Library.
   When I compile with = "gcc -c=20 HelloWorldImp.c", many parse error appears. 
 
   <Error-message = Examples>
      parse error before=20 `jlong'
      parse error before=20 `*'
      parse error before=20 `}'
 
      parse error before=20 `_declspecs'
 
          &nbs= p; and so=20 on       
 
  =20 <HelloWorldImp.c>
      = #include=20 <jni.h>
      #include=20 "HelloWorld.h"
      #include=20 <stdio.h>
 
      = JNIEXPORT void=20 JNICALL
     =20 Java_HelloWorld_displayHelloWorld(JNIEnv *env, jobject obj)=20
     =20 {
          =20 printf("Hello=20 world!\n");
         = ; =20 return;
     =20 } 
 
------=_NextPart_000_005B_01BD5351.E8B6EA80-- - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".