I am having some trouble building a JNI library with Xcode. I have included JavaVM.framework in my project and included the headers. Xcode has no problem resolving defines like JNI_TRUE , JNI_EXPORT , JNI_Call and types like jfloat and jfloatArray . If I write a library with only simple functions using the JNI types everything is fine. The problem comes when I try to use any of the JNI functions such as GetFloatArrayElements(JNIEnv*,jfloatArray,jboolean*) throw an undefined symbol when linking.
I have tried the versions of JavaVM.framework with the 10.6,10.7, and 10.8 SDKs. I have tried with and without adding both the headers and the framework to my build settings in addition to adding the framework in my build phases. I have tried including both jni.h and JavaVM/jni.h.
Does anyone have any suggestions for this or a sample JNI Xcode 4 project they could share? I have read elsewhere about a JNI template with Xcode 4 but I couldn't find anything like that.
I have tried the versions of JavaVM.framework with the 10.6,10.7, and 10.8 SDKs. I have tried with and without adding both the headers and the framework to my build settings in addition to adding the framework in my build phases. I have tried including both jni.h and JavaVM/jni.h.
Does anyone have any suggestions for this or a sample JNI Xcode 4 project they could share? I have read elsewhere about a JNI template with Xcode 4 but I couldn't find anything like that.