android ndk针对libcutils.so的链接

android ndk针对libcutils.so的链接,android,android-ndk,Android,Android Ndk,我试图将一个可执行文件链接到libcutils.so,但出现以下错误: Executable : gps_test /home/jbrew/android_gps/jni/lib_dir//libcutils.so: undefined reference to `ioprio_set' /home/jbrew/android_gps/jni/lib_dir//libcutils.so: undefined reference to `ioprio_get' collect2: ld r

我试图将一个可执行文件链接到libcutils.so,但出现以下错误:

Executable     : gps_test
/home/jbrew/android_gps/jni/lib_dir//libcutils.so: undefined reference to `ioprio_set'
/home/jbrew/android_gps/jni/lib_dir//libcutils.so: undefined reference to `ioprio_get'
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi/gps_test] Error 1
以下是我的Android.mk文件的外观:

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_SRC_FILES:= \
    gps_test.c

LOCAL_LDLIBS:= -L/home/jbrew/android_gps/jni/lib_dir/ -llog -lhardware -lcutils 

LOCAL_C_INCLUDES:= \
    /home/jbrew/android_gps/jni/includes

LOCAL_MODULE:= gps_test

#include $(BUILD_SHARED_LIBRARY)
include $(BUILD_EXECUTABLE)

有没有办法让编译器忽略这些?我试图添加CFLAG--warn unresolved符号,但编译器不知道该标志的含义。

对于其他有此问题的人,问题在于我的API级别。ndk build默认使用android-3进行构建。我在项目路径中添加了一个default.properties文件,然后将“target=android-9”放在该文件中。添加之后,我就可以构建可执行文件了。

对于其他有此问题的人,问题在于我的API级别。ndk build默认使用android-3进行构建。我在项目路径中添加了一个default.properties文件,然后将“target=android-9”放在该文件中。添加后,我可以构建可执行文件。

选择特定API级别的更简单方法是在
Application.mk
中设置
APP\u PLATFORM:=android-9
。选择特定API级别的更简单方法是在
Application.mk
中设置
APP\u PLATFORM:=android-9