You need to compile your code as a libary (ie: DLL in windows), compiler =
is looking for the main, thats why the errors occuring.
There doesn't appear to be anything wrong with your code. Theres a =
tutorial from sun that shows how to create programs using JNI here:
http://java.sun.com/docs/books/tutorial/native1.1/index.html
chris.
----- Original Message -----=20
From: Raj Kolluri=20
To: dev...@li...=20
Sent: Thursday, May 15, 2003 12:34 AM
Subject: [Dev-C++] JNI help
Hi,
I am trying to write a simple C program to see how JNI works.
This is my code:
=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
#include <jni.h>
#include <stdio.h>
# include "HelloWorld.h"
JNIEXPORT void JNICALL
Java_HelloWorld_print(JNIEnv *env, jobject obj)
{
printf("Hello World!\n");
return;
}
=20
=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
When I try to compile the code I get following error:
[Linker error] undefined reference to `WinMain@16'
I am working on Windows 2000 server. Could some one please point me =
in the right direction.
Thanks,
Raj
-------------------------------------------------------------------------=
-----
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
|