D
Daniel Dyer
Hello,
I am having some problems with using some packages and my JNI
application.
I get the famous error
Exception in thread "Thread-1" java.lang.UnsatisfiedLinkError: printMe
at VEViewer.ParticleSLAMProxy.printMe(Native Method)
at VEViewer.J3DARToolkit.run(J3DARToolkit.java:301)
Where there is package called VEViewer and a class called
ParticleSLAMProxy. This class calls the native method printMe in a c++
file :
//C++ file
JNIEXPORT void JNICALL Java_VEViewer_ParticleSLAMProxy_printMe
(JNIEnv * env, jobject obj)
{
printf ("Print Me \n");
}
The library (temp.dll) is found by Java, but the problem is that the
declaration of this native method is not found. I am running this
program from a jar file.
Do you have an idea about what I am doing wrong?
JNI uses C calling conventions. The C++ compiler will mangle your
function names if you don't wrap your C++ code in the following:
#ifdef __cplusplus
extern "C" {
#endif
/* JNI functions go here. */
#ifdef __cplusplus
}
#endif
Dan.