[Android ndk jni] android-ndk-r9d + adt-bundle-windows environment construction-Hello-jni case study, androidndkr9d
Refer to the blog: http://blog.csdn.net/leilu2008/article/details/12495273
My android ndk version is: android-ndk-r9d-windows-x86_64.zip.
Reminder: do not save the package to a directory containing spaces after decompression. Otherwise, the compiler reports an error when compiling c and c ++ in jni.
NDK path cannot contain any spaces!
The version of the Eclipse environment used is: adt-bundle-windows-x86_64-20140321.zip.
Build:
1. decompress the tool separately.
Adt-bundle
Ndk
2. Add the sdk and ndk
Open Window -- "Preferreces
Select the sdk root directory
Select the root directory of the ndk
3. Add the test project hello-jni
Import the hello-jni project under the samples directory under ndk
After the project is imported, add the compiler, select the project, and right-click properties (NDK_builder I prepared in advance, here we want to create a new one)
Select program
Set as shown in the following figure.
Select a project
Bring the compiler up to the first place
In this way, the environment has been set up ~~~~~~~
Run as to start compiling. The libs file is automatically generated, and the so file in libs is automatically added to the java program. The earlier version also requires the build path operation. Very troublesome.
Running effect:
The Android NDK sample program Hello-jni fails to run.
Does native function define and implement matching? What code have you changed?
Android NDK compilation error. when compiling the JNI part of the project, an error is reported. The SO file cannot be generated successfully,
-The lcrypto library libcrypto. so is missing.
What system did you use? Why is there a d disk under linux?
There are also errors in the program.
Jni/OpensslWapper. cpp: 102: error: undefined reference to 'bn _ bn2hex'