Jutikorn
Jutikorn

Reputation: 848

Type 'AndroidBitmapInfo' could not be resolved

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

Upvotes: 0

Views: 1576

Answers (4)

Dhiraj Himani
Dhiraj Himani

Reputation: 1102

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 :)

Upvotes: 0

yushulx
yushulx

Reputation: 12160

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>

Upvotes: 1

eozgonul
eozgonul

Reputation: 810

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

Upvotes: 1

mbrenon
mbrenon

Reputation: 4941

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

#include <android/bitmap.h>

Upvotes: 2

Related Questions