0

I'm a newbie of Android NDK. I want to try create fast blur effect to bitmap and I found a NDK solution from here: Fast Bitmap Blur For Android SDK answered by @zeh

after I did my configuration, I am not able to run the project and It said "Type 'AndroidBitmapInfo' could not be resolved" in the *.c file.

Could you guys tell me how to fix this problem?

Here is my Android.mk

LOCAL_PATH := $(call my-dir)

# Create BitmapUtils library

include $(CLEAR_VARS)

LOCAL_LDLIBS    := -llog -ljnigraphics -landroid

LOCAL_MODULE    := bitmaputils
LOCAL_SRC_FILES := bitmaputils.c

LOCAL_CFLAGS    =  -ffast-math -O3 -funroll-loops

include $(BUILD_SHARED_LIBRARY)

Thank you

Community
  • 1
  • 1
Jutikorn
  • 838
  • 1
  • 11
  • 25

4 Answers4

2

Just in case: have you correctly included the bitmap header?

#include <android/bitmap.h>
mbrenon
  • 4,851
  • 23
  • 25
1

Add the following line to your Application.mk

APP_PLATFORM := android-8

In case you don't use Application.mk, run ndk-build as follows:

ndk-build APP_PLATFORM=android-8
eozgonul
  • 810
  • 6
  • 12
  • I tried your solution by add them to my Android.mk under the "include $(BUILD_SHARED_LIBRARY)" line but I still show me the error. – Jutikorn Sep 10 '13 at 12:53
  • You know Android.mk and Application.mk are two different files right? It looks like you don'T have Application.mk file and as far as I know, bitmap.h is introduced after app platform 8, so that could be the problem causing your module not to locate the header file. – eozgonul Sep 10 '13 at 12:55
  • Sorry, I just noticed that is the Application.mk not Android.mk, I just did it but the error still appear. – Jutikorn Sep 11 '13 at 13:22
1

according to ndk samples\bitmap-plasma\jni, you'd better double check mk file, and header file.

Application.mk
# The ARMv7 is significanly faster due to the use of the hardware FPU
APP_ABI := armeabi armeabi-v7a
APP_PLATFORM := android-8
----------------------------------------------------------------
Android.mk

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE    := plasma
LOCAL_SRC_FILES := plasma.c
LOCAL_LDLIBS    := -lm -llog -ljnigraphics

include $(BUILD_SHARED_LIBRARY)
--------------------------------------------------------
plasma.c
#include <jni.h>
#include <time.h>
#include <android/log.h>
#include <android/bitmap.h>

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
yushulx
  • 11,695
  • 8
  • 37
  • 64
0

The configuration of CDT indexer needs to enable "Index unused headers ..."

To get there: Project->Properties->C/C++ General->Indexer. Than rebuild the project If still this appears than repeat this again.It will be gone :)

Dhiraj Himani
  • 1,062
  • 12
  • 9