• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Questions about native libraries

QuickNick

Newbie
Good day, friends.

I have a lot of questions about NDK development, because I'm really newbie in C++ and nobody in our organization knows this topic well (native libraries and Android).

1. I generated Cpp-header file by javah and compiled Java class. I opened this file in Visual Studio 2010 Express, and, of course "#include <jni.h>" was marked as wrong import. I added path to "jni.h" through Properties Manager ->Configutation Options -> VC++ Directories -> Include directories (translation can be wrong cause I have Russian version and I have to re-translate it to English). Now, header file doesn't show any error, but cpp-file (which uses h-file) marks "jstring" as an error.
What's a problem?

2. I found something strange in generated header.
Code:
JNIEXPORT jstring JNICALL Java_com_dsp_NativeSample_nativeFunction
  (JNIEnv *, jobject);
I have an example (not mine):
Code:
void Java_com_example_Physics_DoFFT(
            JNIEnv* env,
            jobject thiz,
            jdoubleArray data,
            jint size)
As you can see, my generated file hasn't variable names in signature (only types) and another one has types and names in signature.
Also, "JNIEnv*" differs from "JNIEnv *" (sic!)

3. I tried to compile ready example by Android NDK: I had copied Android.mk, Application.mk, and then I tried to execute ndk-build from Cygwin. But Cygwin replied:
ERROR: Cannot find 'make' program. Please install Cygwin make package or define GNUMAKE variable to point to it.
I definitely saw make package. How to define GNUMAKE variable?

Thanks for future answers :)
 
Thanks, I found out that Cygwin had been installed without some important packages 'cause I hadn't checked "Devel" in Setup.
 
Back
Top Bottom