ADT + NDK build jni compiling environment, adtndk build jni
Jni is the interface for android to call the library written in C ++. The difference between C ++ and java is not discussed in this article. In addition, it only records how to build the environment.
First, download the ADT package and the NDK package.
The ADT package contains eclipse, so you do not need to install Eclipse.
After installation, there are two methods to compile the jni project.
One way is to set the NDK path in windows, properties, and build in the ADT menu, and select the default ndk compilation in the project properties.
Another way is to set the NDK path in the menu windows, properties, and build of ADT. At the same time, configure the NDK_ROOT and path in the system environment variables. Then, in the project properties, do not select the default NDK and enter the compilation command.
Because the local machine does not have an installation environment, it cannot. If you are lucky to see this article, contact me if you have any questions.
[Stick to the top] detailed configuration of NDK in window and how to compile it
First download Cygwin and NDK (I am using a android-ndk-r7) When downloading Cygwin we need to select what we want, if you do not know, it is recommended to install all, it only needs to be done at the cost. The current NDK version does not need to be installed, saving the step of Cygwin installation. After the NDK is downloaded, 1. in Cygwin, configure the NDK environment variable (C: \ cygwin \ home \ Administrator \. bash_profile) This is my directory. Find the Cygwin directory, followed by the-home-administrator file name. bash_profile2. open. bash_profile file added the following two lines (ndk can be named casually) ndk =/cygdrive/c/android-ndk-r7 (/cygdrive/drive letter (No:)/ndk directory) export ndk3. open Cygwin and enter cd $ ndk directly to the ndk root directory, after the NDK environment is configured, enter the samples directory of the ndk under any project subdirectory (cd $ ndk/samples/hello-jni ), here we take the hello-jni project as an example and then enter $ ndk/ndk-build for compilation (Gdbserver: [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver Gdbsetup: libs/armeabi/gdb. setup Install: libhello-jni.so => libs/armeabi/libhello-jni.so) Congratulations, compilation is successful if not open awk.exe... if an exception occurs, go to the ndk directory and find the prebuilt \ windows \ bindirectory. Then, change awk.exe to any name.
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'