Mail Archives: cygwin/1998/03/22/05:13:31
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.
<Error-message Examples>
parse error before `jlong'
parse error before `*'
parse error before `}'
parse error before `_declspecs'
and so on
<HelloWorldImp.c>
#include <jni.h>
#include "HelloWorld.h"
#include <stdio.h>
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>
<META content=3D"text/html; charset=3DcsISO2022JP" =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.71.1712.3"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000000 size=3D2>Dear,</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2> I'm trying to =
integrate=20
native code with Java programs.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2> I implemented =
four steps as=20
follows</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2> =
Step 1:=20
Write th Java Code</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2> =
Step 2:=20
Compile the Java Code</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2> =
Step 3:=20
Create the .h File</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2> =
Step 4:=20
Write the Native Method Implementation</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2> =
Step 5:=20
Create a Shared Library</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2> But at Step 5, I cannot =
create a=20
Shared Library.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2> When I compile with =
"gcc -c=20
HelloWorldImp.c", many parse error appears.</FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT><FONT =
size=3D2></FONT> </DIV>
<DIV><FONT size=3D2> <Error-message =
Examples></FONT></DIV>
<DIV><FONT size=3D2> parse error before=20
`jlong'</FONT></DIV>
<DIV><FONT size=3D2> parse error before=20
`*'</FONT></DIV>
<DIV><FONT size=3D2> parse error before=20
`}'</FONT></DIV>
<DIV><FONT size=3D2></FONT><FONT color=3D#000000 =
size=3D2> </FONT></DIV>
<DIV><FONT size=3D2> parse error before=20
`_declspecs'</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT=20
size=3D2> &nbs=
p; and so=20
on </FONT></DIV>
<DIV><FONT size=3D2> </FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2> =20
<HelloWorldImp.c></FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2> =
#include=20
<jni.h><BR> #include=20
"HelloWorld.h"<BR> #include=20
<stdio.h></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2> =
JNIEXPORT void=20
JNICALL <BR> =20
Java_HelloWorld_displayHelloWorld(JNIEnv *env, jobject obj)=20
<BR> =20
{<BR> =20
printf("Hello=20
world!\n");<BR>  =
; =20
return;<BR> =20
} </FONT> </DIV></BODY></HTML>
------=_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".
- Raw text -