Three ways eclipse automatically compiles ndk/jni

Source: Internet
Author: User

First, Eclipse Association Cygwin

1. Right click on select properties-> Select Builders, select New in builders to create a program

2. Parameter configuration

Ii. Eclipse Associated Ndk-build (self-built builder method)

1. Project->properties->builders->new, create a new builder

2. Parameter configuration

2.1 Main

①name:ndk_builder

②location is the path to Ndk-build.cmd, can be an absolute path, or it can be in the form of an environment variable, that is, ${android_ndk}\ndk-build.cmd, where ANDROID_NDK is a configured NDK path

③working Directory, for the current project.

Here the expression of ${} is using the EC environment variable, can use the variables ... button to find some 3 EC environment variables.

For the configuration on Linux, just like the configuration here, simply change the address of location to Ndk-build.

2.2 Refresh

2.3 Build Options

Note: Only modify Ndk-build.cmd to Ndk-build in Linux environment

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, refer to OpenCV instance 1

3. Convert an Android project to a C + + project (which has C + + properties), e.g., convert to a C + + C + +, New.

4. Configure the NDK compilation path, Project->properties, where Build-command android_ndk is the ANDROID-NDK path configured in the environment variable; build-directory is the current project directory

5. Configure the engineering properties, Project->properties, for example, OpenCV for example, where CNU C and GNU C + + are configured with a OPENCV link library

6. Configure Ndk_module_path, such as

Three ways eclipse automatically compiles ndk/jni

Related Article

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.