2

所以,我无法停止收到错误消息

致命错误:android_native_app_glue.h:没有这样的文件或目录

在尝试编译应用程序时。真的吓到我了。我已经在项目设置中指定了android_native_app_glue的路径,但这没有任何意义。我还可以做些什么?

(操作系统视窗 7)

制作文件看起来像

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := droidblaster
LOCAL_SRC_FILES := Main.cpp EventLoop.cpp Log.cpp
LOCAL_LDLIBS := -landroid -llog
LOCAL_STATIC_LIBRARIES := android_native_app_glue

$(call import-module,android/native_app_glue)

include $(BUILD_SHARED_LIBRARY)
4

4 回答 4

1

这可能很晚使文件没有指向正确的库使用

LOCAL_STATIC_LIBRARIES := android_native_app_glue

Malte Schmitz的回答中遗漏了这一点

你也可以参考

android-ndk-文件夹\sources\android\native_app_glue\Android.mk

请参考 NDK 中给出的示例源

于 2014-03-06T11:11:59.747 回答
1

I think you can fix it this way:
Try first calling:

include $(BUILD_SHARED_LIBRARY)

and after that

$(call import-module,android/native_app_glue)

like this:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := droidblaster
LOCAL_SRC_FILES := Main.cpp EventLoop.cpp Log.cpp
LOCAL_LDLIBS := -landroid -llog
LOCAL_STATIC_LIBRARIES := cpufeatures
LOCAL_STATIC_LIBRARIES += android_native_app_glue
LOCAL_STATIC_LIBRARIES += ndk_helper

include $(BUILD_SHARED_LIBRARY) 

$(call import-module,android/native_app_glue)

but maybe you just forgot to include it in your files?

于 2013-01-07T17:08:39.917 回答
0

如果它对某人有用,您需要在 Project Properties -> C/C++ General -> Paths and Symbols 中包含路径 /path/to/android-ndk/sources/android/native_app_glue(通过 GNU C 和 GNU C++ 语言项)

于 2015-01-09T07:51:46.050 回答
0

利用:

LOCAL_STATIC_LIBRARIES := cpufeatures android_native_app_glue ndk_helper

为我工作。

于 2014-09-08T13:11:32.100 回答