D
david
#pragma FLAME ON //to be read in voice of Col. Potter, MASH
What in blazes is going on HERE. Why is javah creating this bogus prototype?
Who in God's green earth is responsible for NOT DOCUMENTING this confounded
behavior of javah
#pragma FLAME OFF
"javah -jni" creates fn prototype:
JNIEXPORT void JNICALL
Java_home_0002fdavid_0002fsourcecode_0002fSomeClass_doNoth
ing
(JNIEnv *, jobject);
from java code:
package home.david.sourcecode;
static { System load("/path/to/libSomething.so"); }
public Class SomeClass{
public void doNothing(){}
}
libSomething.so is created from 'gcc -ansi -I <path> ...' using the function
prototypes generated by javah (see above)
Some 'java test code' is developed. And when we try to call doNothing() we
get the Unsatisfied Link Error.
After MUCH pain, I realized the Unsatisfied Link Error would go away and I'd
get proper operation by changing the function definitions from what javah
generated to (eliminating the mangle? junk??):
JNIEXPORT void JNICALL Java_home_david_sourcecode_SomeClass_doNothing
(JNIEnv *, jobject);
#pragma FLAME ON HIGH
WHY IS JAVAH DOING THIS? WHAT THE HECK IS GOING ON? IS JAVAH NOT COMPATIBLE
WITH gcc or g++ (I tried both, with and without extern "C" {} stuff.)
WOULD SOMEONE AT SUN PLEASE DOCUMENT THIS!!
RH linux and gcc are not Solaris, but should WHAT THE!!
What in blazes is going on HERE. Why is javah creating this bogus prototype?
Who in God's green earth is responsible for NOT DOCUMENTING this confounded
behavior of javah
#pragma FLAME OFF
"javah -jni" creates fn prototype:
JNIEXPORT void JNICALL
Java_home_0002fdavid_0002fsourcecode_0002fSomeClass_doNoth
ing
(JNIEnv *, jobject);
from java code:
package home.david.sourcecode;
static { System load("/path/to/libSomething.so"); }
public Class SomeClass{
public void doNothing(){}
}
libSomething.so is created from 'gcc -ansi -I <path> ...' using the function
prototypes generated by javah (see above)
Some 'java test code' is developed. And when we try to call doNothing() we
get the Unsatisfied Link Error.
After MUCH pain, I realized the Unsatisfied Link Error would go away and I'd
get proper operation by changing the function definitions from what javah
generated to (eliminating the mangle? junk??):
JNIEXPORT void JNICALL Java_home_david_sourcecode_SomeClass_doNothing
(JNIEnv *, jobject);
#pragma FLAME ON HIGH
WHY IS JAVAH DOING THIS? WHAT THE HECK IS GOING ON? IS JAVAH NOT COMPATIBLE
WITH gcc or g++ (I tried both, with and without extern "C" {} stuff.)
WOULD SOMEONE AT SUN PLEASE DOCUMENT THIS!!
RH linux and gcc are not Solaris, but should WHAT THE!!