Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android bitmap.h is not found for native code compile

I am trying to compile code using the Android NDK. I have previously used this code fine, but changed one thing in it and now it will not compile. The error that shows up is:

"Compile++ thumb : filters <= filters.cpp
C:/Android/my-app//jni/filters.cpp:4:28: fatal error: android
/bitmap.h: No such file or directory
compilation terminated.
make: *** [C:/Android/my-app//obj/local/armeabi/objs/filters/
filters.o] Error 1

My bitmap.h file is defined in the library as:

#include <android/bitmap.h>

I know that bitmap.h is only there after a target-skd build of 8 or higher, and mine is a target of 10 and min of 8. Any suggestions? This is driving me crazy and used to work!Thanks for any help you can provide.

Edit: Here is my Android.mk file also

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE    := filters
LOCAL_SRC_FILES := filters.cpp
LOCAL_LDLIBS    := -lm -llog -ljnigraphics

include $(BUILD_SHARED_LIBRARY)
like image 699
user1132897 Avatar asked Dec 05 '22 15:12

user1132897


1 Answers

Got it to work. I was using SDK tools revision 20, and platform-tools revision 12. In order to get it to compile, I had to specify the APP_PLATFORM in the command line (apparently these revisions default to something else).

Just ran:

ndk-build APP_PLATFORM=android-8

and it built!

like image 160
user1132897 Avatar answered Dec 27 '22 09:12

user1132897