java - Extern "C" giving error "Linkage specification is not allowed" even after adding def. in header file? -
this code in main.cpp file:
extern "c" jniexport jint jnicall java_somefnhandling_jni_1someinit (jnienv * env, jobject , jstring var1, jstring var2) { //rest part of code in here }
this definition in main.h file:
#ifdef __cplusplus extern "c" { #endif jniexport jint jnicall java_someufnhandling_jni_1someinit (jnienv *, jobject, jstring, jstring); #ifdef __cplusplus } #endif
this program taking 2 parameters java file , passing dll using jni interface in file i'm getting error:
linkage specification not allowed
i'm using vc++ generate dll file , have tried find same solution mentioning add def. in header file. after doing error still remains same. idea?
i removed method calling in main function , put outside of main , started working charm
Comments
Post a Comment