"Android" Eclipse three ways to proactively compile Ndk/jni
Skyseraph Sep. 18th 2014
Email:[email protected]
First, Eclipse Association Cygwin
1. Project , right-click Select properties-> Select Builders, Select New in Builders to Create a Program
2. Configuration of the parameters
TwoEclipse Association ndk-build (self-built builder method)
1. project->properties->builders->new, create a new Builder
2. Configuration of the parameters
2.1 Main
①name:ndk_builder
②location is the path of ndk-build.cmd, can see the absolute path, also can be in the form of environment variable, namely ${android_ndk}\ndk-build.cmd, ANDROID_NDK for the configured NDK path
③working Directory, for the current project.
The expression of ${} Here is an environment variable using the EC. can use Variables...button to find some 3 EC environment variables.
For the configuration on Linux. As with the configuration here, just change the address of location to Ndk-build
2.2 Refresh
2.3 Build Options
Note: The Linux environment only needs to change ndk-build. cmd to ndk-build
iii.Eclipse associated ndk-build (using the CDT method)
1. Pre-Preparation : Eclipse environment +android Environment +eclipse C + + Environment
2. write Android Java/jni code, can refer to OpenCV instance 1
3. Convert your Android project to a C + + project (make it a C + + property), for example. Convert to a C + + C + + Project, New.
4. Configure the NDK compilation path,project->properties. For example with. android_ndk in Build-command is the ANDROID-NDK path configured in the environment variable . build-directory for the current project folder
5. Configure the project properties. project->properties, for example, this example takes OpenCV as an example, where CNU C and GNU C + + are configured with a OpenCV link Library
========
by SkySeraph-2014
SYNC Skyseraph Cnblog
"Android" Eclipse three ways to proactively compile Ndk/jni