Using Codeblock for JNI development-2016.01.31

Source: Internet
Author: User
Tags configuration settings

Use the cross-compiling tool to implement JNI development under Andorid platform, record codeblock configuration process, and facilitate subsequent reference.

1 Tool Version Information

NDK r8b

Code::Blocks 10.05

2 configuration process

Using Codeblock for JNI development does not require writing makefile files, but instead uses an image interface to set up information such as Android platforms, API versions, and compilers.

The process is as follows:

Codeblok->settings->compile and Debugger->global complier Settings Select "GNU RAM selected" in Complier Gcccompiler Select the "Copy" button, enter a new name, we recommend to use the NDK version number to name, and press "Set as default".

In the Compiler Settings tab, you can add a custom variable in defines that is used during subsequent path configuration.

Set up common libraries and link options that need to be linked

Set header file Lookup path

Set the link library path

Set the NDK Compilation tool path

Set Debug Tool Path

At this point, all the public configuration settings are complete, click "OK" to save.

Below, for the specific compilation library configuration.

In the Managerment view window, select the project you want to configure, and in the menu project, Build options, open the Settings dialog box.

First select the compiler we configured earlier:

Compilation option settings

Link option settings:

Find path settings for the header file of the dependent library:

To rely on the custom library file lookup path:

Where the relative path is relative to the project project file path "*.CBP".

Custom compilation settings, which can be used in a custom variable form during a compile link. The specific reference method is $ (varname).

The "Build Targets" in Project->properties configures the target information for the compilation. Example: Compile target type, file name, and so on.

After the configuration is complete, execute build->rebuild to compile the project.

Using Codeblock for JNI development-2016.01.31

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.