The Universal Blog Park Ah ... Hope to be able to find out the error as soon as possible after the issue record%>_<%
Problem Description:
Generate a dynamic-link library by compiling C files with the GCC command under Linux. so file times wrong. The previous command imported the jni.h and jni_md.h the path, error, and then copy the two header files to the/usr/include/path,
Import, still error.
Check the java_home path, Java, Javac command can be normal operation, normal. c files can also be compiled. According to the indication of the error is the. h file Jint, Jbyte ... Not defined ... But according to my
Shallow cognition, these variables are not defined in the jni.h ... That's a headache.
[Email protected]:~/documents/temp$GCC-shared-i/usr/include/jnitest.c-o libhello.soinfileIncluded From/usr/include/jni_md.h: +:0, from/usr/include/jni.h: $, from JniTest.h:2, from jnitest.c:2:/usr/include/jawt.h:141:5: Error:unknown type name ' Jint ' Jint x; ^/usr/include/jawt.h:142:5: Error:unknown type name ' Jint ' Jint y; ^/usr/include/jawt.h:143:5: Error:unknown type name ' Jint ' jint width; ^/usr/include/jawt.h:144:5: Error:unknown type name ' jint ' jint height; ^/usr/include/jawt.h:167:5: Error:unknown type name ' Jint ' Jint clipsize; ^/usr/include/jawt.h: the:5: Error:unknown type name ' jnienv ' jnienv*Env; ^/usr/include/jawt.h:192:5: Error:unknown type name ' Jobject ' jobject target; ^/usr/include/jawt.h:208:5: error:expected specifier-qualifier-list before ' Jint ' Jint (Jnicall*Lock)^/usr/include/jawt.h:242:5: Error:unknown type name ' Jint ' jint version; ^/usr/include/jawt.h:252: *: error:expected ') ' before ' *' token jawt_drawingsurface* (Jnicall *getdrawingsurface)^/usr/include/jawt.h:257: +: error:expected ') ' before ' *' token void ' (Jnicall*freedrawingsurface)^/usr/include/jawt.h:263: +: error:expected ') ' before ' *' token void ' (Jnicall*lock) (jnienv*Env); ^/usr/include/jawt.h:268: +: error:expected ') ' before ' *' token void ' (Jnicall*unlock) (jnienv*Env); ^/usr/include/jawt.h:280:5: error:expected '; ' Before ' Jobject ' Jobject (Jnicall*getcomponent) (jnienv*Env, void*platforminfo); ^/usr/include/jawt.h:288:1: Error:unknown type name ' _jni_import_or_export_ ' _jni_import_or_export_^/usr/include/jawt.h:289:Ten: error:expected ' =', ', ', ' ; ', ' asm ' or ' __attribute__ ' before ' Jnicall ' Jboolean jnicall jawt_getawt (jnienv*Env, jawt*AWT); ^/usr/include/jawt.h:289:Ten: Error:unknown type name ' Jnicall ' infileIncluded from/usr/include/jni.h: $:0, from JniTest.h:2, from jnitest.c:2:/usr/include/jni_md.h: -: -: error:expected ') ' before ' *' tokenint(Jnicall *getawtcolor) (jawt_drawingsurface*DS,^inchfileIncluded from JniTest.h:2:0, from jnitest.c:2:/usr/include/jni.h: the:1: Error:unknown type name ' jint ' typedef jint jsize;^/usr/include/jni.h:122:5: Error:unknown type name ' Jbyte ' Jbyte b; ^/usr/include/jni.h: the:5: Error:unknown type name ' Jint ' Jint i; ^/usr/include/jni.h:126:5: Error:unknown type name ' Jlong ' Jlong J; ^/usr/include/jni.h: -:5: error:expected specifier-qualifier-list before ' Jint ' Jint (Jnicall*getversion) (JNIENV *Env); ^/usr/include/jni.h:1869:5: Error:unknown type name ' Jint ' jint version; ^/usr/include/jni.h:1871:5: Error:unknown type name ' Jint ' Jint noptions; ^/usr/include/jni.h:1877:5: Error:unknown type name ' Jint ' jint version; ^/usr/include/jni.h:1895:5: error:expected specifier-qualifier-list before ' Jint ' Jint (Jnicall*DESTROYJAVAVM) (JAVAVM *VMs); ^/usr/include/jni.h:1934:1: Error:unknown type name ' Jniimport ' _jni_import_or_export_ jint jnicall^/usr/include/jni.h:1934: in: error:expected ' =', ', ', ' ; ', ' asm ' or ' __attribute__ ' before ' Jnicall ' _jni_import_or_export_ jint jnicall ^/usr/include/jni.h:1934: in: Error:unknown type name ' Jnicall '/usr/include/jni.h:1937:1: Error:unknown type name ' Jniimport ' _jni_import_or_export_ jint jnicall^/usr/include/jni.h:1937: in: error:expected ' =', ', ', ' ; ', ' asm ' or ' __attribute__ ' before ' Jnicall ' _jni_import_or_export_ jint jnicall ^/usr/include/jni.h:1937: in: Error:unknown type name ' Jnicall '/usr/include/jni.h:1940:1: Error:unknown type name ' Jniimport ' _jni_import_or_export_ jint jnicall^/usr/include/jni.h:1940: in: error:expected ' =', ', ', ' ; ', ' asm ' or ' __attribute__ ' before ' Jnicall ' _jni_import_or_export_ jint jnicall ^/usr/include/jni.h:1940: in: Error:unknown type name ' Jnicall '/usr/include/jni.h:1944:1: Error:unknown type name ' Jniexport ' jniexport jint jnicall^/usr/include/jni.h:1944: -: error:expected ' =', ', ', ' ; ', ' asm ' or ' __attribute__ ' before ' Jnicall ' Jniexport jint jnicall^/usr/include/jni.h:1944: -: Error:unknown type name ' Jnicall '/usr/include/jni.h:1947: One: error:expected ' =', ', ', ' ; ', ' asm ' or ' __attribute__ ' before ' void ' jniexport void Jnicall^inchfileIncluded from Jnitest.c:2:0: JniTest.h: the: One: error:expected ' =', ', ', '; ', ' asm ' or ' __attribute__ ' before ' void ' jniexport void Jnicall java_jnitest_output^jnitest.c:4: One: error:expected ' =', ', ', '; ', ' asm ' or ' __attribute__ ' before ' void ' jniexport void Jnicall java_jnitest_output (jnienv*Env, Jobject obj)^
Errors occurred during the implementation of JNI under Linux ... "Not resolved"