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