因为Bitmap.h缺少的Android NDK不会建库? [英] Android NDK won't build library because Bitmap.h is missing?
问题描述
我在使用Android NDK建立一个图书馆。我拥有了一切运作良好,但我需要改变它在图书馆引用的包名。我试过一次我做了改变,其文件夹中调用NDK的构建又构建库,但是这是唯一的输出我得到的,它似乎并没有完全建设:
I'm using the Android NDK to build a library. I had everything working well, but then I needed to change a package name which is referenced in the library. I tried to build the library again once I made the change, by calling ndk-build in its folder, but this is the only output I get and it does not seem to be fully building:
C:\my-app\jni>ndk-build -B
"Compile++ thumb : filters <= filters.cpp
C:/a-fa-outsidelands//jni/filters.cpp:4:28: fatal error: android/bitmap.h: No such file or directory
compilation terminated.
这随后导致了不合适的链接错误,当我尝试运行应用程序。我会后我的.mk文件,但我不认为应该的问题,因为我的previous库与此.mk文件上工作。我做的是重建(-b参数),因为它是超过previous构建。有什么建议么?这是我的.mk文件:
This then leads to an unsatisfied link error when I try to run the application. I'll post my .mk file, but I don't think that should matter because my previous library was working with this .mk file. I'm doing the rebuild (the -B parameter) because it is over a previous build. Any suggestions? Here's my .mk file:
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)
感谢您的帮助。
推荐答案
什么是的android:targetSdkVersion
在应用程序的清单? IIRC, bitmap.h
未出台之前,SDK V8。
What's the android:targetSdkVersion
in the app's manifest? IIRC, bitmap.h
was not introduced until SDK v8.
编辑:当时在同一台机器上的最后一个成功的构建,用同样的NDK版本?是否#include行使用&LT;机器人/ bitmap.h&GT;
,而不是的Android / bitmap.h
?
Was the last successful build on the same machine, with the same NDK version? Does the #include line use <android/bitmap.h>
as opposed to "android/bitmap.h"
?
EDIT2:那些自上次编译的targetSdkVersion变化?我发现了一个有趣的事:有没有的android-10
在 Android的NDK-XX \\平台
。尝试在 Android的NDK-XX \\平台
和复制的内容<$ C创建一个空白的android-10
文件夹$ C> Android的9 那里。我真的不知道要检查什么。
Did the targetSdkVersion change since the last build? I found a funny thing: there's no android-10
under android-ndk-xx\platforms
. Try creating a blank android-10
folder under android-ndk-xx\platforms
and copying the contents of android-9
there. I'm honestly not sure what else to check.
这篇关于因为Bitmap.h缺少的Android NDK不会建库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!