4

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

3 に答える 3

15

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!

于 2012-07-26T15:23:53.120 に答える
1

Insert APP_PLATFORM=android-8 into file Application.mk

于 2014-10-14T10:04:56.997 に答える
0

Well, the answer bellow helped me also. I tried setting the APP_PLATFORM variabile to android-10 from Application.mk (as I expected this option should also be where the APP_ABI is), but that didn't help. Pretty non-intuitive, but whatever works, right..?

于 2013-01-29T11:25:21.843 に答える