我正在尝试使用Android NDK编译我的C代码。我按照Android developer NDK Page的建议下载并安装,并尝试按规定编译,但似乎有一些问题,我似乎不知道它是什么。
*** Command Line compile code **
C:\cygwin\android-ndk-r7c>ndk-build -C C:\Users\BoosterJack\workspace\workAndroid
Android NDK: Trying to define local module 'stdc++' in C:/cygwin/android-ndk-r7c/sources/cxx-stl/system/Android.mk.
Android NDK: But this module was already defined by C:/cygwin/android-ndk-r7c/sources/cxx-stl/system/Android.mk.
make: Entering directory `C:/Users/BoosterJack/workspace/workAndroid'
C:/cygwin/android-ndk-r7c/build/core/build-module.mk:34: *** Android NDK: Aborting. . Stop.
make: Leaving directory `C:/Users/BoosterJack/workspace/workAndroid'
我的make文件也很简单。任何帮助将不胜感激。
# Include makefiles here.
include $(LOCAL_PATH)/Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := NativeLibjni
LOCAL_SRC_FILES := NativeLib.c
include $(BUILD_SHARED_LIBRARY)
当我从makefile中删除该行时,包括$(LOCAL_PATH)/Android.mk,我得到正确的输出
C:\Users\BoosterJack>ndk-build -C C:\Users\BoosterJack\workspace\workAndroid
make: Entering directory `C:/Users/BoosterJack/workspace/workAndroid'
"Compile thumb : NativeLibjni <= NativeLib.c
SharedLibrary : libNativeLibjni.so
Install : libNativeLibjni.so => libs/armeabi/libNativeLibjni.so
make: Leaving directory `C:/Users/BoosterJack/workspace/workAndroid'
答案 0 :(得分:4)
为什么使用include $(LOCAL_PATH)/Android.mk