"We human being, always find a solution, maybe not today, but if you really want to solve a problem, there’s always a way" – Ma Yun @ Stanford, 2013
Tag Archives: ndk

Android ndk makefile – Android.mk vs Application.mk

by Md Imran Hasan Hira

Android.mk and Application.mk – these are the two important files which are used in android ndk project build lifecycle. Those who got to work with android ndk projects are better familiar with these two.

 

I first encounter with these at my office for a project. To build ndk application I needed to add necessary configurations to those files. There are two help file for Android.mk and Application.mk . The help files are located into the “NDK_ROOT/docs/ANDROID-MK.html” and “NDK_ROOT/docs/APPLICATION-MK.html” where NDK_ROOT is the directory where your ndk files are located in.

To be master on android ndk build toolchain one first need to read the two help files. Here are some highlights about what we can do with this files-

 

Application.mk file

1. APP_PROJECT_PATH – configure the c/cpp source file directory

2. APP_OPTIM – mode debug or release

3. APP_CFLAGS / APP_CPPFLAGS – settings for compiler flags

4. APP_ABI – configure machine code generation for different CPU architechture, like MIPS, x86, armeabi etc.

5. APP_STL – choose C++ runtime library, needed to configure using C++ stl classes

 

 

Android.mk file:

1. Including source files, ony by one or using regular expression to recursively choose files

2. How to include prebuilt static or shared library files ?

3. What kind of target the project will be built with, like – share library or static library or machine executable file ?

4. How to build different modules from the codebase ?

5. LOCAL_CPP_FEATURES for using rtti ( Run time type information ) and/or cpp exceptions.

6. and some other important things included in the build toolchain.

 


Android ndk project – unresolved inclusion or symbol issue in eclipse

by Md Imran Hasan Hira

I am working with a android ndk project in eclipse at my office. The problem is eclipse doesn’t find some c++ header files. I rephrase it, android gcc compiles and build the project OK, but eclipse intellisense find that there are thousands ( near every line of my code ) of inclusion error, which there aren’t.

 

I find that sometimes eclipse can not index it’s resources properly. To index manually you need to

1. Right click on the Project from the Project Explorer,

2. Select Index Menu

3. Select Rebuild

4. Also the menu Freshen All Files

 

You can also perform “Search for unresolved inclusions” to find out which header files eclipse are missing.

 

Here is a screenshot of the menus –

Fix Unresolved Inclusion

Fix Unresolved Inclusion

 


Theme by Ali Han | Copyright 2025 Md Imran Hasan Hira | Powered by WordPress