Errors while compiling C++ file for JNI
843829Oct 31 2008 — edited Nov 5 2008Hi all
I'm trying to create a simple "hello world" in C++ and call it form java class.I followed the tutorial from SUN to implement this.I generated '.h' file for java class and using that method
signature in the c++ function.However i'm getting these errors
`JNICALL' does not name a type
'JNIESPORT' does not name a type
here is my c++ code: ('HelloWorld.h" is the file generated from java class using the command javah -h classname)
#include <iostream>
#include <jni.h>
#include <iostream.h>
#include "HelloWorld.h"
using namespace std;
JNIEXPORT void JNICALL Java_HelloWorld_print_1hello
(JNIEnv *, jobject){
cout<<"welcome sree!!"<<endl;
};
I'm doing anything wrong?? or did the jni.h file is not included properly.Any help is appreciated.
thanks,
Sree