如何修复NDK构建错误:pread failed:是目录吗?

时间:2016-06-16 18:36:17

标签: android android-ndk

当我在android上构建一些本机代码时出现以下错误:

/Users/jerikc/Library/Android/android-ndk-r10d/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: fatal error: /Users/jerikc/workdir/workspace/projuect: pread failed: Is a directory
collect2: error: ld returned 1 exit status

ndk版本是:r10d

Android.mk:

LOCAL_MODULE    := libpng
LOCAL_SRC_FILES += \
    ../jniLibs/$(TARGET_ARCH_ABI)/libpng.a
LOCAL_EXPORT_C_INCLUDES += \
    libpng
include $(PREBUILT_STATIC_LIBRARY)

LOCAL_MODULE    := libjpeg
LOCAL_SRC_FILES += \
    ../jniLibs/$(TARGET_ARCH_ABI)/libjpeg.a
LOCAL_EXPORT_C_INCLUDES += \
    libjpeg
include $(PREBUILT_STATIC_LIBRARY)

LOCAL_MODULE    := libcrypto
LOCAL_SRC_FILES += \
    ../jniLibs/$(TARGET_ARCH_ABI)/libcrypto.a

include $(PREBUILT_STATIC_LIBRARY)


include $(CLEAR_VARS)
LOCAL_MODULE    := processing
LOCAL_SRC_FILES += filter_jni.c \
        control.c

LOCAL_CFLAGS := -g -O3 -ffast-math
LOCAL_LDLIBS := -llog -lm -lz
LOCAL_STATIC_LIBRARIES += libpng  libjpeg libcrypto

include $(BUILD_SHARED_LIBRARY)

1 个答案:

答案 0 :(得分:0)

你必须使用$(CLEAR_VARS)来清理你现在正在使用的本地变量。

以下是链接,您可以在其中找到有关它的有用信息:http://android.mk/

我认为,以下版本将解决您的问题。我现在没有系统检查它。

value