我想构建 expolid 代码(https://github.com/revolutionary/zergRush/blob/master/zergRush.c)
安卓.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := zergRush
LOCAL_SRC_FILES := zergRush.c
base :=E:\0.Android\system\core
#//base path include the android source code. but i forget the version .maybe 4.0.1
LOCAL_C_INCLUDES :=$(base)/include/
LOCAL_LDLIBS := -llog -lcutils
LOCAL_STATIC_LIBRARIES := libcutils libc
LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
LOCAL_MODULE_TAGS := eng debug
LOCAL_FORCE_STATIC_EXECUTABLE := true
include $(BUILD_EXECUTABLE)
这台电脑已经安装了ndk-r9b。
libcutils.so : D:\android-ndk-r9b\platforms\android-19\arch-arm\usr\lib\rs
所以我把它复制到 D:\android-ndk-r9b\platforms\android-19\arch-臂\usr\lib。
default.properties project.properties 设置目标=19
但是 ndk-build 失败了。
D:\test\roottest\jni>ndk-build
[armeabi] Compile thumb : zergRush <= zergRush.c
[armeabi] Executable : zergRush
D:/android-ndk-r9b/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6
/../../../../arm-linux-androideabi/bin/ld.exe: error: cannot find -lcutils
D:/android-ndk-r9b/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6
/../../../../arm-linux-androideabi/bin/ld.exe: D:/test/roottest//obj/local/armeabi/objs/zergRush/zergRush.o: in function
do_fault:D:/test/roottest//jni/zergRush.c:226: error: undefined reference to 'socket_local_client'
D:/android-ndk-r9b/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6
/../../../../arm-linux-androideabi/bin/ld.exe: D:/test/roottest//obj/local/armeabi/objs/zergRush/zergRush.o: in function
main:D:/test/roottest//jni/zergRush.c:488: error: undefined reference to 'property_set'
D:/android-ndk-r9b/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6
/../../../../arm-linux-androideabi/bin/ld.exe: D:/test/roottest//obj/local/armeabi/objs/zergRush/zergRush.o: in function
main:D:/test/roottest//jni/zergRush.c:619: error: undefined reference to 'property_get'
collect2: ld returned 1 exit status
make.exe: *** [D:/test/roottest//obj/local/armeabi/zergRush] Error 1
我想知道如何包含使用定义的库路径或包含 libcutils.so,我可以制作程序。谢谢。