"Android" Eclipse three ways to proactively compile Ndk/jni

Source: Internet
Author: User

"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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.